Documentation ¶
Index ¶
Constants ¶
View Source
const ( RedisCluster = "cluster" RedisSingle = "single" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisInterface ¶
type RedisInterface interface { Set(k string, v interface{}, expir ...time.Duration) (err error) Get(k string) (v string, err error) Del(k string) (err error) HSet(k string, field string, v interface{}) (err error) HGet(k string, field string) (res string, err error) HDelAll(k string) (err error) HDel(k string, field string) (err error) Close() error Subscribe(channels ...string) *redis.PubSub Publish(channel string, message interface{}) error }
func NewRedisClient ¶
func NewRedisClient(cf *config.Config) (RedisInterface, error)
func NewRedisCluster ¶
func NewRedisCluster(hosts []string, password string) RedisInterface
func NewRedisSingle ¶
func NewRedisSingle(host, password string, db int) RedisInterface
Click to show internal directories.
Click to hide internal directories.