Documentation ¶
Overview ¶
Package cache implement a cache which backend by redis
Index ¶
- func Delete(key string) error
- func Exists(key string) bool
- func Expire(k string, expire int) error
- func Get(key string) (interface{}, error)
- func IncrKey(key string) (int, error)
- func Int(key string) (int, error)
- func MustBootUp(logger log.Logger, addr string) types.Closer
- func Set(k string, v interface{}) error
- func SetExpire(k string, v interface{}, expire uint32) error
- func SetStruct(k string, v interface{}) error
- func SetStructExpire(k string, v interface{}, expire int) error
- func String(key string) (string, error)
- func Struct(token string, v interface{}) error
- func TTL(key string) (int, error)
- func Update(key string, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expire ¶
Synonyms of Redis EXPIRE command Expire set a key-value pair's expired time( by second)
func MustBootUp ¶
MustBootUp boot up a shard cache, it will panic if failed
func SetExpire ¶
Synonyms of Redis SETEX command save a key-value pair with expired time( by second)
func SetStructExpire ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.