redisx

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 9 Imported by: 0

README

go-redisx

go-redisx

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoAddr = errors.New("redisx:no addr")
View Source
var RedisClusterMap = make(map[string]*Cacher)

Functions

func CloseRedis

func CloseRedis() error

func GetPool

func GetPool(clusterList ...string) redis.Conn

func InitRedis

func InitRedis(conf Conf) (err error)

Types

type Cacher

type Cacher struct {
	Prefix string
	// contains filtered or unexported fields
}

type Conf

type Conf struct {
	Mode         string                // 模式,支持 default/sentinel
	ProxyConf    map[string]*ProxyConf // 地址配置
	SentinelConf *SentinelConf         // 哨兵配置
}

type ProxyConf

type ProxyConf struct {
	AddrList       []string
	MaxActive      int
	MaxIdle        int
	Downgrade      bool
	Network        string
	Password       string
	Db             int
	Prefix         string
	IdleTimeout    time.Duration
	ConnectTimeout time.Duration
	ReadTimeout    time.Duration
	WriteTimeout   time.Duration
	Wait           bool
}

type SentinelConf

type SentinelConf struct {
	MasterName string
	Master     *ProxyConf
	Slave      *ProxyConf
	*ProxyConf
}

Jump to

Keyboard shortcuts

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