Documentation
¶
Overview ¶
缓存模块
Index ¶
- func Clear() error
- func Exists(keys string) bool
- func Get(key string) (string, error)
- func GetString(key string) string
- func GetStruct(key string, val any) error
- func Key(args ...any) string
- func Regedit(conf *Config)
- func Remove(key string) error
- func Set(key, val string) error
- func SetExt(key, val string, t time.Duration) error
- func SetStruct(key string, val any) error
- func SetStructExt(key string, val any, t time.Duration) error
- type Config
- type RedisType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Hosts string // Redis连接地址 Pass string // redis密码 RedisSelect uint8 // redis查询库 ErrFunc func(msg string, err error) // Redis报错记录函数,用于记录Redis的报错信息 // 以下的配置模块为程序内部使用的配置 Conn *redis.Pool // redis连接配置 CacheSync sync.Map // 程序内缓存定时 Connect redis.Conn // redis连接 DefaultTime time.Duration // 默认缓存时长 }
因xgodb.Cachexxxxx使用稍微有些繁杂,所以此处将缓存模块进一步精简,并逐步废弃xgodb.Cachexxx操作
Click to show internal directories.
Click to hide internal directories.