Documentation
¶
Index ¶
- func Clear(db string) error
- func Del(db, key string) error
- func Delex(key string) error
- func GetString(db, key string) (string, error)
- func GetStruct(db, key string, reply any) error
- func GetexString(key string) (string, error)
- func GetexStruct(key string, reply any) error
- func Init(cfg CacheConfig)
- func SetString(db, key, value string) error
- func SetStruct(db, key string, value any) error
- func SetexString(key, value string, expires int) error
- func SetexStruct(key string, value any, expires int) error
- type CacheConfig
- type DialConfig
- type PoolConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheConfig ¶
type CacheConfig struct { Mode string `mapstructure:"mode"` Prefix string `mapstructure:"prefix"` Addrs []string `mapstructure:"addrs"` Pool PoolConfig `mapstructure:"pool"` Dial DialConfig `mapstructure:"dial"` }
缓存配置
type DialConfig ¶
type DialConfig struct { ReadTimeout int `mapstructure:"read-timeout"` WriteTimeout int `mapstructure:"write-timeout"` ConnectTimeout int `mapstructure:"connect-timeout"` Password string `mapstructure:"password"` Database int `mapstructure:"database"` KeepAlive int `mapstructure:"keep-alive"` }
连接参数
Click to show internal directories.
Click to hide internal directories.