redismgr

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConn

func GetConn() (c redis.Conn)

GetConn return a redis.Conn instance

func Init

func Init(conf *RedisConfig)

Init initialize the global RedisConnectionManager instance

func TryRedisCmd

func TryRedisCmd(ctx context.Context, strategy retry.ResettableStrategy, cmd string, args ...interface{}) (reply interface{}, err error)

TryRedisCmd retry a redis command with respect of the circuit breaker status

func TryRedisScript

func TryRedisScript(ctx context.Context, strategy retry.ResettableStrategy, script *redis.Script, keysAndArgs ...interface{}) (reply interface{}, err error)

TryRedisScript run a lua script with the respect of the circuit breaker status

func Uninit

func Uninit()

Uninit do the clean up for the global RedisConnectionManager instance

Types

type RedisConfig

type RedisConfig struct {
	Addrs          []string
	MaxIdle        int
	MaxActive      int
	ConnectTimeout time.Duration
	ReadTimeout    time.Duration
	WriteTimeout   time.Duration
	IdleTimeout    time.Duration
	Wait           bool
}

RedisConfig defines the redis config

type RedisConnectionManager

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

RedisConnectionManager is the redis connection manager

Jump to

Keyboard shortcuts

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