redisclient

package
v0.0.0-...-0569e1c Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedisClientManagerInit

func RedisClientManagerInit(configs []RedisClientConfig) error

Types

type RedisClient

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

func NewRedisClient

func NewRedisClient(c RedisClientConfig) (*RedisClient, error)

func (*RedisClient) Close

func (r *RedisClient) Close() error

func (*RedisClient) CloseConn

func (r *RedisClient) CloseConn() error

func (*RedisClient) Do

func (r *RedisClient) Do(commandName string, args ...interface{}) (reply interface{}, err error)

func (*RedisClient) Err

func (r *RedisClient) Err() error

func (*RedisClient) Get

func (r *RedisClient) Get() redis.Conn

type RedisClientConfig

type RedisClientConfig struct {
	Name         string
	Addr         string
	Active       int // pool
	Idle         int // pool
	DialTimeout  int
	ReadTimeout  int
	WriteTimeout int
	IdleTimeout  int
	DBNum        string // db数据库序号
	Password     string
}

Redis client config

type RedisClientManager

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

func GetRedisClientManager

func GetRedisClientManager() *RedisClientManager

func (*RedisClientManager) GetRedisClient

func (r *RedisClientManager) GetRedisClient(name string) *RedisClient

Jump to

Keyboard shortcuts

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