redis_client

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

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

Go to latest
Published: Sep 26, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRedisClientManager

func GetRedisClientManager() map[string]*RedisPool

func InstallRedisClientManager

func InstallRedisClientManager(configs []RedisConfig)

Types

type RedisConfig

type RedisConfig struct {
	Name         string // redis name
	Addr         string
	Active       int // pool
	Idle         int // pool
	DialTimeout  base.Duration
	ReadTimeout  base.Duration
	WriteTimeout base.Duration
	IdleTimeout  base.Duration

	DBNum    string // db号
	Password string // 密码
}

Redis client config.

func (*RedisConfig) ToRedisCacheConfig

func (c *RedisConfig) ToRedisCacheConfig() string

type RedisPool

type RedisPool struct {
	*redis.Pool
	// contains filtered or unexported fields
}

func GetRedisClient

func GetRedisClient(redisName string) (client *RedisPool)

func NewRedisPool

func NewRedisPool(c *RedisConfig) (pool *RedisPool)

func (*RedisPool) Close

func (p *RedisPool) Close() error

func (*RedisPool) Get

func (p *RedisPool) Get() redis.Conn

Jump to

Keyboard shortcuts

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