gredis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisMaxIdle        = 10  //最大空闲连接数
	RedisIdleTimeoutSec = 240 //连接保持超时时间(秒)
)

Variables

View Source
var RedisPool *redis.Pool

Functions

func Delete

func Delete(key string) (bool, error)

Delete delete a kye

func Do

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

func Exists

func Exists(key string) (bool, error)

Exists check a key

func Get

func Get(key string) (interface{}, error)

Get get a key

func GetBoolean

func GetBoolean(key string) (bool, error)

func GetFloat64

func GetFloat64(key string) (float64, error)

func GetInt

func GetInt(key string) (int, error)

func GetInt64

func GetInt64(key string) (int64, error)

func GetLock

func GetLock(lockKey string, expiration int64) (bool, error)

GetLock 获取Redis锁

func GetString

func GetString(key string) (string, error)

func GetUint64

func GetUint64(key string) (uint64, error)

func ReleaseLock

func ReleaseLock(lockKey string) bool

ReleaseLock 释放 Redis 锁

func Set

func Set(key string, value interface{}) (bool, error)

func Setup

func Setup(redisURL string)

Setup Initialize the Redis instance

Types

This section is empty.

Jump to

Keyboard shortcuts

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