utils

package
v0.0.0-...-6a878bf Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAddr       = errors.New("invalid addr")
	ErrStopMigrateByUser = errors.New("migration stopped by user")
)

Functions

func DialTo

func DialTo(addr string, passwd string) (redis.Conn, error)

func DialToTimeout

func DialToTimeout(addr string, passwd string, readTimeout, writeTimeout time.Duration) (redis.Conn, error)

func GetExecutorPath

func GetExecutorPath() string

func GetRedisConfig

func GetRedisConfig(addr, passwd string, configName string) (string, error)

func GetRedisStat

func GetRedisStat(addr, passwd string) (map[string]string, error)

func GetZkLock

func GetZkLock(zkConn zkhelper.Conn, productName string) zkhelper.ZLocker

func InitConfig

func InitConfig() (*cfg.Cfg, error)

func SlaveNoOne

func SlaveNoOne(addr, passwd string) error

func SlaveOf

func SlaveOf(slave, passwd string, master string) error

func SlotsInfo

func SlotsInfo(addr, passwd string, fromSlot, toSlot int) (map[int]int, error)

func SlotsMgrtTagSlot

func SlotsMgrtTagSlot(c redis.Conn, slotId int, toAddr string) (int, int, error)

Types

type ConnBuilder

type ConnBuilder interface {
	// Get a conn that will retry automatically when getting error caused by connection issues.
	// If retry can not rebuild the connection, there will be a fetal error
	GetSafeConn() zkhelper.Conn

	// Get a conn that will return error caused by connection issues
	// It will try to rebuild the connection after return error.
	GetUnsafeConn() zkhelper.Conn
}

func NewConnBuilder

func NewConnBuilder(buildFunc func() (zkhelper.Conn, error)) ConnBuilder

type Strings

type Strings []string

func (Strings) Eq

func (s1 Strings) Eq(s2 []string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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