redispool

package
v0.1.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(key string) error

func GetJSON

func GetJSON(key string, v interface{}) error

func GetString

func GetString(key string) (string, error)

func InitCache

func InitCache(cli *redis.Client)

func InitRedis

func InitRedis(group, key string) error

func IsExistKey

func IsExistKey(key string) (bool, time.Duration)

func Redis

func Redis() *redis.Client

func SetJSON

func SetJSON(key string, v interface{}, expired time.Duration) error

func SetString

func SetString(key, value string, timeout time.Duration) error

func Std

func Std() *redis.Client

func WechatCache

func WechatCache() *wechatCache

WechatCache 兼容微信包的cache

Types

type Cache

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

func CacheInstance

func CacheInstance() *Cache

func (*Cache) Del

func (c *Cache) Del(key string) error

func (*Cache) Get

func (c *Cache) Get(key string) (string, error)

func (*Cache) IsExist

func (c *Cache) IsExist(key string) bool

func (*Cache) SetEx

func (c *Cache) SetEx(key, data string, expired time.Duration) error

func (*Cache) TTL

func (c *Cache) TTL(key string) time.Duration

Jump to

Keyboard shortcuts

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