Documentation
¶
Index ¶
- Constants
- Variables
- func Add(name string, option Option)
- func AddMap(name string, setting map[string]interface{})
- func AddMapBatch(batch map[string]interface{})
- func Cluster(name string) *redis.ClusterClient
- func Lock(name string, expire time.Duration) bool
- func Sentinel(name string) *redis.Client
- func Unlock(name string)
- func Use(name string) *redis.Client
- type MaxMin
- type Option
Constants ¶
View Source
const ( KeyBase = "general:" //基础 KeyLock = KeyBase + "lock:" //锁 )
Variables ¶
View Source
var ( Ctx = context.Background() Nil = redis.Nil )
Functions ¶
func AddMapBatch ¶
func AddMapBatch(batch map[string]interface{})
Types ¶
type Option ¶
type Option struct { Address []string `json:"address"` //地址,字符串数组 Password string `json:"password"` //密码,默认空 DB int `json:"db"` //db PoolSize int `json:"pool_size"` //连接池最大数量,默认100 MinIdleConns int `json:"min_idle_conns"` //最小空闲连接数,默认0 MaxIdleConns int `json:"max_idle_conns"` //最大空闲连接数,默认0(无限制) ConnMaxIdleTime time.Duration `json:"conn_max_idle_time"` //连接最大空闲时间,默认5分钟 MasterName string `json:"master_name"` //Sentinel集群模式,主库名称,默认mymaster TLS bool `json:"tls"` //是否启用TLS,默认使用系统根证书 }
Click to show internal directories.
Click to hide internal directories.