gredis

package
v0.0.0-...-411a92d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedisConn *redis.Pool

Functions

func Decode

func Decode(data []byte, to interface{}) error

------------------- Decode 用gob进行数据解码

func Delete

func Delete(prefix string, keyValue ...interface{}) (bool, error)

删除key方法

func Encode

func Encode(data interface{}) ([]byte, error)

-------------------- Encode 用gob进行数据编码

func Exists

func Exists(prefix string, keyValue ...interface{}) bool

判断key是否存在方法,存在返回true,不存在返回false

func Get

func Get(to interface{}, prefix string, keyValue ...interface{}) bool

获取key方法,存在返回true,否则返回false。注意参数顺序:接受对象,key前缀,key值数组

func LikeDeletes

func LikeDeletes(key string) error

关键字删除key方法

func Set

func Set(data interface{}, expire int, prefix string, keyValue ...interface{}) error

添加缓存方法。注意参数顺序:缓存对象,过期时间(单位为秒),key前缀,key值数组

func Setup

func Setup() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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