client

package
v0.0.0-...-5b294ad Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressSplitter        = "@"
	AddressClusterSplitter = ";"

	RoleMaster = "master"
	RoleSlave  = "slave"
)

Variables

This section is empty.

Functions

func HandleAddress

func HandleAddress(address, password, authType string) ([]string, error)

Types

type RedisClient

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

func NewRedisClient

func NewRedisClient(redisHost RedisHost, db int32) (RedisClient, error)

func (*RedisClient) CheckHandleNetError

func (p *RedisClient) CheckHandleNetError(err error) bool

func (*RedisClient) Close

func (p *RedisClient) Close()

func (*RedisClient) Connect

func (p *RedisClient) Connect() error

func (*RedisClient) Do

func (p *RedisClient) Do(commandName string, args ...interface{}) (interface{}, error)

func (*RedisClient) FetchBaseInfo

func (p *RedisClient) FetchBaseInfo(isCluster bool) (map[int32]int64, []string, error)

* Get base db info. * Return: * map[int32]int64: logical db node map. * []string: physical db nodes.

func (*RedisClient) FetchValueUseScan_Hash_Set_SortedSet

func (p *RedisClient) FetchValueUseScan_Hash_Set_SortedSet(oneKeyInfo *common.Key, onceScanCount int) (map[string][]byte, error)

func (*RedisClient) PipeExistsCommand

func (p *RedisClient) PipeExistsCommand(keyInfo []*common.Key) ([]int64, error)

func (*RedisClient) PipeLenCommand

func (p *RedisClient) PipeLenCommand(keyInfo []*common.Key) ([]int64, error)

func (*RedisClient) PipeRawCommand

func (p *RedisClient) PipeRawCommand(commands []combine, specialErrorPrefix string) ([]interface{}, error)

func (*RedisClient) PipeSismemberCommand

func (p *RedisClient) PipeSismemberCommand(key []byte, field [][]byte) ([]interface{}, error)

func (*RedisClient) PipeTTLCommand

func (p *RedisClient) PipeTTLCommand(keyInfo []*common.Key) ([]bool, error)

func (*RedisClient) PipeTypeCommand

func (p *RedisClient) PipeTypeCommand(keyInfo []*common.Key) ([]string, error)

func (*RedisClient) PipeValueCommand

func (p *RedisClient) PipeValueCommand(keyInfo []*common.Key) ([]interface{}, error)

func (*RedisClient) PipeZscoreCommand

func (p *RedisClient) PipeZscoreCommand(key []byte, field [][]byte) ([]interface{}, error)

func (RedisClient) String

func (p RedisClient) String() string

type RedisHost

type RedisHost struct {
	Addr         []string
	Password     string
	TimeoutMs    uint64
	Role         string // "source" or "target"
	Authtype     string // "auth" or "adminauth"
	DBType       int
	DBFilterList map[int]struct{} // whitelist
}

func (RedisHost) IsCluster

func (p RedisHost) IsCluster() bool

func (RedisHost) String

func (p RedisHost) String() string

Jump to

Keyboard shortcuts

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