redisCache

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedisPoolList = map[string]*redis.Pool{} //存放连接池信息

Functions

func AddRedisPool

func AddRedisPool(name string, conf *RedisConf)

添加新的redis连接池

func GetRedisClient

func GetRedisClient(name string) redis.Conn

func NewRedisPool

func NewRedisPool(conf *RedisConf) *redis.Pool

创建redis pool连接池 If Wait is true and the pool is at the MaxActive limit, then Get() waits for a connection to be returned to the pool before returning.

Types

type RedisConf

type RedisConf struct {
	Host        string
	Port        int
	Password    string
	Database    int
	MaxIdle     int //空闲pool个数
	MaxActive   int //最大激活数量
	IdleTimeout int //最大连接超时,单位s
}

redis连接信息

func (*RedisConf) SetRedisPool

func (this *RedisConf) SetRedisPool(name string)

Jump to

Keyboard shortcuts

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