redisClient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(redisConfig Config) error

func Init_

func Init_(name string, redisConfig Config) error

Init a new instance.

If only need one instance, use empty name "". Use GetDefaultInstance() to get.
If you need several instance, run Init() with different <name>. Use GetInstance(<name>) to get.

Types

type Config

type Config struct {
	Address   string
	UserName  string
	Password  string
	Port      int
	KeyPrefix string
	UseTLS    bool
}

type RedisClient

type RedisClient struct {
	KeyPrefix string
	*redis.ClusterClient
}

func GetInstance

func GetInstance() *RedisClient

func GetInstance_

func GetInstance_(name string) *RedisClient

func (*RedisClient) GenKey

func (rc *RedisClient) GenKey(keys ...string) string

Jump to

Keyboard shortcuts

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