fdredis

package
v0.0.0-...-3ce3758 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRedis

func InitRedis(host string, db int) (err error)

*

  • 初始化Redis(host一般为127.0.0.1:6379))

Types

type RedisClient

type RedisClient struct {
	*redis.Pool
}

func GetRedisClient

func GetRedisClient() *RedisClient

func (*RedisClient) Delete

func (r *RedisClient) Delete(key string) (err error)

func (*RedisClient) GetObject

func (r *RedisClient) GetObject(key string, obj interface{}) (err error)

func (*RedisClient) GetString

func (r *RedisClient) GetString(key string) (value string, err error)

func (*RedisClient) SaveObject

func (r *RedisClient) SaveObject(key string, obj interface{}) (err error)

func (*RedisClient) SaveObjectWithExpireTime

func (r *RedisClient) SaveObjectWithExpireTime(key string, obj interface{}, expireTime int) (err error)

*

  • 保存并设置过期时间(EX:秒,PX:毫秒)

func (*RedisClient) SaveString

func (r *RedisClient) SaveString(key string, value string) (err error)

func (*RedisClient) SaveStringWithExpireTime

func (r *RedisClient) SaveStringWithExpireTime(key string, value string, expireTime int) (err error)

*

  • 保存并设置过期时间(EX:秒,PX:毫秒)

Jump to

Keyboard shortcuts

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