redislib

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL