Documentation ¶
Index ¶
- Variables
- func AddMembersToSet(key string, values ...interface{}) (interface{}, error)
- func CacheConf() cache.ClusterConf
- func Del(key string) error
- func DelMembersInSet(key string, values ...interface{}) error
- func Do(cmds ...interface{}) (interface{}, error)
- func Get(key string) *redis.StringCmd
- func GetAllMembersFromSet(key string) (interface{}, error)
- func GetCache(key string, v Encoder) error
- func GetInt(key string) (int, error)
- func GetInt64(key string) (int64, error)
- func GetString(key string) (string, error)
- func GetUint64(key string) (uint64, error)
- func Incr(key string) (int64, error)
- func Initialize(ctx contextx.Context, opfs ...func(rdb RdbConfig))
- func LockExec(key string, f func(key string)) error
- func MembersCountOfSet(key string) (int64, error)
- func Publish(channel string, message interface{}) error
- func Set(key string, value interface{}, expiration time.Duration) error
- func SetCache(key string, v Encoder) error
- func SetInt(key string, value int) error
- func SetString(key, value string) error
- func Subscribe(f func(channel, msg string), channel ...string) error
- type Encoder
- type RdbConfig
- type Redis
- func (rd *Redis) Close() error
- func (rd *Redis) Del(ctx contextx.Context, keys ...string) *redis.IntCmd
- func (rd *Redis) Do(ctx contextx.Context, args ...interface{}) *redis.Cmd
- func (rd *Redis) Get(ctx contextx.Context, key string) *redis.StringCmd
- func (rd *Redis) HGetAll(ctx contextx.Context, key string) *redis.StringStringMapCmd
- func (rd *Redis) HMSet(ctx contextx.Context, key string, value ...interface{}) *redis.BoolCmd
- func (rd *Redis) Incr(ctx contextx.Context, key string) *redis.IntCmd
- func (rd *Redis) Ping(ctx contextx.Context) *redis.StatusCmd
- func (rd *Redis) Publish(ctx contextx.Context, channel string, message interface{}) *redis.IntCmd
- func (rd *Redis) Set(ctx contextx.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
- func (rd *Redis) SetAddrs(addrs string)
- func (rd *Redis) SetDB(db int)
- func (rd *Redis) SetNX(ctx contextx.Context, key string, value interface{}, expiration time.Duration) *redis.BoolCmd
- func (rd *Redis) SetPassword(password string)
- func (rd *Redis) SetPingTime(pingTime time.Duration)
- func (rd *Redis) SetUsername(username string)
- func (rd *Redis) SetWaitTimeout(waitTime time.Duration)
- func (rd *Redis) Subscribe(ctx contextx.Context, channels ...string) (*redis.PubSub, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAddr = "127.0.0.1:6379"
View Source
var DefaultClusterAddrs = "127.0.0.1:7001;127.0.0.1:7002;127.0.0.1:7003;127.0.0.1:7004;127.0.0.1:7005;127.0.0.1:7006"
View Source
var NotReadyErr = errors.New("RedisNotReady")
View Source
var RDB = &Redis{}
Functions ¶
func AddMembersToSet ¶
func CacheConf ¶
func CacheConf() cache.ClusterConf
func DelMembersInSet ¶
func GetAllMembersFromSet ¶
func Initialize ¶
func MembersCountOfSet ¶
Types ¶
type Redis ¶
type Redis struct { Addrs string // 连接地址 Username string // 用户名 Password string // 密码 DB int // 数据库名 WaitTimeout time.Duration PingTime time.Duration // contains filtered or unexported fields }
func (*Redis) SetPassword ¶
func (*Redis) SetPingTime ¶
func (*Redis) SetUsername ¶
func (*Redis) SetWaitTimeout ¶
Click to show internal directories.
Click to hide internal directories.