1 Star 0 Fork 0

carlmax_my/console-core-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cache.go 1.57 KB
一键复制 编辑 原始数据 按行查看 历史
carlmax_my 提交于 2024-12-02 21:32 . init project
package cache
import (
"time"
"gitee.com/carlmax_my/console-core-go/pkg/trace"
)
type Option func(*option)
// type Trace = trace.T
type option struct {
Trace *trace.Trace
Redis *trace.Redis
// add other cache module options
}
func NewOption() *option {
return &option{}
}
type Cache interface {
// i()
Set(key string, value interface{}, ttl time.Duration, options ...Option) error
SetT(key string, value interface{}, ttl time.Duration, trace trace.T) error
Get(key string, options ...Option) (string, error)
GetT(key string, trace trace.T) (string, error)
TTL(key string) (time.Duration, error)
Expire(key string, ttl time.Duration) (bool, error)
ExpireAt(key string, ttl time.Time) (bool, error)
Exists(keys ...string) (bool, error)
CheckGet(key string, options ...Option) (string, error)
CheckGetT(key string, trace trace.T) (string, error)
Del(key string, options ...Option) (int64, error)
DelT(key string, trace trace.T) (int64, error)
GetScanKeys(pattern string) (result []string, err error)
GetSScanKeys(key string, pattern string) (result []string, err error)
GetHScanKeys(key string, pattern string) (result []string, err error)
SMembers(key string) ([]string, error)
SIsMember(key, member string) bool
SAdd(key, member string) error
SRem(key, member string) error
Keys(pattern string) (r []string, err error)
// HMSET KEY_NAME FIELD1 VALUE1 ...FIELD-N VALUE-N
HMSet(key string, values ...interface{}) (bool, error)
HMGet(key string, field ...string) ([]interface{}, error)
Publish(channel string, message interface{}) (int64, error)
Close() error
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/carlmax_my/console-core-go.git
git@gitee.com:carlmax_my/console-core-go.git
carlmax_my
console-core-go
console-core-go
v0.0.32

搜索帮助