feat: msg local cache

This commit is contained in:
withchao
2024-01-08 16:47:39 +08:00
parent 1ae523dcc2
commit 3d77c1c8cf
6 changed files with 63 additions and 26 deletions
+32
View File
@@ -0,0 +1,32 @@
package option
var (
t = true
f = false
)
type Option struct {
enable *bool
key []string
}
func (o *Option) Enable() *Option {
o.enable = &t
return o
}
func (o *Option) Disable() *Option {
o.enable = &f
return o
}
func (o *Option) DelKey(key ...string) *Option {
if len(key) > 0 {
if o.key == nil {
o.key = key
} else {
o.key = append(o.key, key...)
}
}
return o
}