Documentation ¶
Overview ¶
Package redislib is for encapsulating github.com/go-redis/redis any operations
As a quick start:
client, err := redislib.NewGORedisClient(redislib.GORedisConfig{URL: "redis://localhost:6379"}, nil) if err != nil { panic(err) } fmt.Println(client.Ping(context.Background()).Err()) client, err := redislib.NewGORedisClusterClient(redislib.GORedisClusterConfig{Addrs: []string{":7000", ":7001", ":7002", ":7003", ":7004", ":7005"}}, nil) if err != nil { panic(err) } fmt.Println(client.Ping(context.Background()).Err())
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GORedisClient ¶
type GORedisClient struct {
*redis.Client
}
func NewGORedisClient ¶
func NewGORedisClient(config GORedisConfig, customOpts *redis.Options) (*GORedisClient, error)
type GORedisClusterClient ¶
type GORedisClusterClient struct {
*redis.ClusterClient
}
func NewGORedisClusterClient ¶
func NewGORedisClusterClient(config GORedisClusterConfig, customOpts *redis.ClusterOptions) (*GORedisClusterClient, error)
type GORedisClusterConfig ¶
type GORedisClusterConfig struct {
Addrs []string
}
type GORedisConfig ¶
type GORedisConfig struct {
URL string
}
Click to show internal directories.
Click to hide internal directories.