Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrWrongType = errors.New("wrong type") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Set(key, value string, ttl time.Duration) error
Get(key string) (string, error)
Del(key string) error
GetTTL(key string) (time.Duration, error)
SetTTL(key string, ttl time.Duration) error
SubCache(prefix string) Cache
Close() error
}
func NewPrefixCache ¶
type ExtendedCache ¶
type ExtendedCache interface {
Cache
LPush(key string, values ...string) error
RPush(key string, values ...string) error
LPop(key string, count int) ([]string, error)
RPop(key string, count int) ([]string, error)
LLen(key string) (int, error)
LRange(key string, start, stop int) ([]string, error)
SAdd(key string, values ...string) error
SRem(key string, values ...string) error
SHas(key, value string) (bool, error)
SLen(key string) (int, error)
Incr(key string, increment int64) (int64, error)
SubExtendedCache(prefix string) ExtendedCache
}
func NewPrefixExtendedCache ¶
func NewPrefixExtendedCache(cache ExtendedCache, prefix string) ExtendedCache
Click to show internal directories.
Click to hide internal directories.