1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-27 01:48:27 +08:00
icebergs/misc/alpha/cache.go
2021-10-24 23:23:08 +08:00

24 lines
715 B
Go

package alpha
import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/mdb"
kit "shylinux.com/x/toolkits"
)
const CACHE = "cache"
func init() {
Index.Merge(&ice.Context{Configs: map[string]*ice.Config{
CACHE: {Name: "cache", Help: "缓存", Value: kit.Data(
kit.MDB_SHORT, "word", kit.MDB_FIELD, "time,word,translation,definition",
)},
}, Commands: map[string]*ice.Command{
CACHE: {Name: "cache word auto", Help: "缓存", Action: ice.MergeAction(map[string]*ice.Action{
mdb.CREATE: {Name: "create word translation definition", Help: "创建"},
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
mdb.HashSelect(m, arg...)
}},
}})
}