diff --git a/core/env.go b/core/env.go new file mode 100644 index 0000000..d49f2ee --- /dev/null +++ b/core/env.go @@ -0,0 +1,19 @@ +package core + +import "fmt" + +var env = NewBucket("env") + +func init() { + // var xa = `https://jintia.jintias.cn/api/xatx.php?msg={{1}}` + // replies := []string{ + // `你是,(.*)?=>你好,我是{{1}}。`, + // `(小爱\S*)=>gjson(req(xa,1), text)`, + // } + // fmt.Println(replies) + var template = ` +var content = {{1}} + + ` + fmt.Println(template) +} diff --git a/core/sys.go b/core/sys.go index 25d7f10..f899add 100644 --- a/core/sys.go +++ b/core/sys.go @@ -13,7 +13,12 @@ import ( "github.com/astaxie/beego/logs" ) +var BeforeStop = []func(){} + func Daemon() { + for _, bs := range BeforeStop { + bs() + } args := os.Args[1:] execArgs := make([]string, 0) l := len(args)