redisx

package module
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-redisx

go-redisx

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAddr = errors.New("redisx: no addr")
View Source
var ErrNoDefaultPool = errors.New("redisx: no default pool")

Functions

This section is empty.

Types

type ClusterConf added in v0.2.0

type ClusterConf struct {
	ProxyConf
}

type Conf

type Conf struct {
	Mode         string        // 模式,支持 single/sentinel/cluster
	SingleConf   *ProxyConf    // 地址配置
	SentinelConf *SentinelConf // 哨兵配置
	ClusterConf  *ClusterConf  // 集群配置
}

type Conn added in v0.3.3

type Conn = redis.Conn

type Pool added in v0.2.0

type Pool interface {
	Get() redis.Conn
	Close() error
}

type Pools added in v0.2.0

type Pools struct {
	// contains filtered or unexported fields
}

func InitRedis

func InitRedis(confs []*Conf) Pools

func (*Pools) Close added in v0.3.4

func (v *Pools) Close()

func (*Pools) GetPool added in v0.2.0

func (v *Pools) GetPool(l ...string) Conn

type ProxyConf

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

type SentinelConf

type SentinelConf struct {
	Master   *ProxyConf
	Slave    *ProxyConf
	UseSlave bool
	ProxyConf
}

Jump to

Keyboard shortcuts

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