redis

package
v0.0.0-...-59da782 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const EXPIRETimeDay = 24 * 60 * 60 //一天
View Source
const EXPIRETimeHalfDay = 12 * 60 * 60 //半天
View Source
const EXPIRETimeHour = 60 * 60 //一小时

key过期时间 所有key都设置了过期时间

View Source
const EXPIRETimeMonth = 30 * 24 * 60 * 60 //一周
View Source
const EXPIRETimeWeek = 7 * 24 * 60 * 60 //一周
View Source
const LockTimeout = 3 //3秒

锁超时时间

Variables

This section is empty.

Functions

func GetConn

func GetConn() redis.Conn

func GetConnByKey

func GetConnByKey(key string) redis.Conn

func GetHash

func GetHash(str string) int

func InitRedis

func InitRedis(conf *nodeConfig)

初始化连接池

func IsExists

func IsExists(reply interface{}, err error) (bool, error)

func RegistRedis

func RegistRedis(cfg *types.Config)

Types

type RedisLock

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

func (*RedisLock) Lock

func (this *RedisLock) Lock(rd *redis.Conn, timeout int) error

func (*RedisLock) Unlock

func (this *RedisLock) Unlock(rd *redis.Conn)

Jump to

Keyboard shortcuts

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