Documentation
¶
Overview ¶
Package redis
@author: xwc1125
Package redis ¶
@author: xwc1125
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
func New ¶
func New(config RedisConfig) (*DB, error)
func (*DB) ClusterRedis ¶
func (r *DB) ClusterRedis() *redis.ClusterClient
type RedisConfig ¶
type RedisConfig struct { Mode Mode `json:"is_guard" mapstructure:"is_guard"` Addr []string `json:"addr" mapstructure:"addr"` Username string `json:"username" mapstructure:"username" yaml:"username"` Password string `json:"password" mapstructure:"password"` DB int `json:"db" mapstructure:"db"` MasterName string `json:"master_name" mapstructure:"master_name"` CacheExpire int64 `json:"cache_expire" mapstructure:"cache_expire"` // 过期时间[秒] }
RedisConfig reids配置
Click to show internal directories.
Click to hide internal directories.