Documentation ¶
Index ¶
- func ExampleClusterUsage()
- func ExampleUsage()
- func GetClusterInstance() *redisLib.ClusterClient
- func GetInstance() *redisLib.Client
- func InitRedis(conf Conf)
- func InitRedisCluster(conf ClusterConf)
- func New(conf Conf) *redisLib.Client
- func NewCluster(conf ClusterConf) *redisLib.ClusterClient
- type Addr
- type ClusterConf
- type Conf
- type OptionsClusterFields
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClusterInstance ¶
func GetClusterInstance() *redisLib.ClusterClient
GetClusterInstance 获取redis集群连接实例
Types ¶
type Addr ¶
type Addr struct { Host string `yaml:"host" toml:"host" json:"host" default:"localhost"` //主机地址 Port int `yaml:"port" toml:"port" json:"port" default:"6379"` //端口 Username string `yaml:"username" toml:"username" json:"username"` //用户名 Password string `yaml:"password" toml:"password" json:"password"` //密码 }
type ClusterConf ¶
type ClusterConf struct { SSLEnable bool `yaml:"ssl_enable" toml:"ssl_enable" json:"ssl_enable"` //是否启用ssl AddrList []Addr `yaml:"addr_list" toml:"addr_list" json:"addr_list"` //连接地址列表 }
ClusterConf 集群配置信息
type Conf ¶
type Conf struct { Addr Database int `yaml:"database" toml:"database" json:"database"` //数据库名 SSLEnable bool `yaml:"ssl_enable" toml:"ssl_enable" json:"ssl_enable"` //是否启用ssl }
Conf 配置信息
type OptionsClusterFields ¶
OptionsClusterFields 配置项字段
Click to show internal directories.
Click to hide internal directories.