Documentation ¶
Index ¶
- Constants
- func Client(name ClientName) *redis.Client
- func ConvertStringToMap(base map[string]string) map[string]interface{}
- func InitClient(config *Config) (*redis.Client, error)
- type Cao
- func (c *Cao) Del(key string) error
- func (c *Cao) DelPipeline(keys []string) error
- func (c *Cao) DelPipelined(keys []string) error
- func (c *Cao) Expire(key string, extime int64) error
- func (c *Cao) ExpireAt(key string, ex time.Time) error
- func (c *Cao) Get(key string) (string, error)
- func (c *Cao) HDel(key string, fields string) error
- func (c *Cao) HGet(key string, field string) (string, error)
- func (c *Cao) HGetAll(key string) map[string]interface{}
- func (c *Cao) HGetJSON(key, field string, T interface{}) error
- func (c *Cao) HMSet(key string, fields map[string]interface{}) error
- func (c *Cao) HSet(key string, field string, value interface{}) error
- func (c *Cao) HSetJSON(key, field string, value interface{}) error
- func (c *Cao) Keys(pattern string) ([]string, error)
- func (c *Cao) Scan(cursor uint64, match string, count int64) ([]string, uint64, error)
- func (c *Cao) Set(key string, value string) error
- func (c *Cao) SetByTTL(key string, value string, extime int64) error
- func (c *Cao) SetTTL(key string, extime int64) error
- type ClientName
- type Config
Constants ¶
View Source
const ( SessionPrefix = "wpmanage." // SessionPrefix 工作手机团队session前缀(所有团队要统一) LRUCachePrefix = "lru." // LRUCachePrefix lru缓存前缀 FIFOCachePrefix = "fifo." // FIFOCachePrefix fifo缓存前缀 SessionForMobilePrefix = "wpapp." // SessionForMobilePrefix 工作手机团队session前缀(所有团队要统一) )
Prefix 缓存前缀配置(一级命名空间管理,放在底层package中,方式各自维护各自的导致命名空间冲突)
View Source
const ( MINUTE = 60 // 分钟 HOUR = MINUTE * 60 // 小时 HALFHOUR = MINUTE * 30 // 半小时 DAY = HOUR * 24 // 天 LRUDuration = MINUTE * 10 // lru持续时间 LRUDurationByDay = DAY * 10 // lru持续时间 day FIFODuration = MINUTE * 10 // fifo缓存持续时间 )
time 缓存时间配置
Variables ¶
This section is empty.
Functions ¶
func ConvertStringToMap ¶
ConvertStringToMap 转换从redis获取的数据
Types ¶
type Cao ¶
type Cao struct {
// contains filtered or unexported fields
}
Cao 缓存访问结构
type ClientName ¶
type ClientName string
ClientName redis连接名称
const ( MKSession ClientName = "session" MKCache ClientName = "cache" )
ClientName redis连接名称
Click to show internal directories.
Click to hide internal directories.