Documentation ¶
Index ¶
- Constants
- Variables
- type Cache
- func (c *Cache) Close()
- func (c *Cache) Del(keys ...string) error
- func (c *Cache) DeleteKeyMatch(match string) (int, error)
- func (c *Cache) Get(key string) (string, bool, error)
- func (c *Cache) Search(match string, cursor, limit int) ([]string, int, error)
- func (c *Cache) SearchMaxIter(match string, cursor, limit int, maxIter int) ([]string, int, error)
- func (c *Cache) Set(key, value string, expire time.Duration) error
- func (c *Cache) WipeLocal()
- type DeleteErrors
- type Redis
- func (r *Redis) Close()
- func (r *Redis) Del(keys ...string) error
- func (r *Redis) DeleteKeyMatch(match string) (int, error)
- func (r *Redis) DeleteKeyMatchFn(match string, keyFn func(string)) (int, error)
- func (r *Redis) Get(key string) ([]byte, bool, error)
- func (r *Redis) Keys(match string) ([]string, error)
- func (r *Redis) RunCmd(command string, args ...interface{}) (*gore.Reply, error)
- func (r *Redis) Scan(cursor int, match string) (xs []string, newCursor int, err error)
- func (r *Redis) ScanAtLeast(match string, cursor, limit int) ([]string, int, error)
- func (r *Redis) ScanAtLeastWithMaxIter(match string, cursor, limit int, maxIter int) ([]string, int, error)
- func (r *Redis) ScanIterate(match string, cursor int, consumer func([]string) bool) (int, error)
- func (r *Redis) Set(key string, value interface{}, expire time.Duration) error
Constants ¶
View Source
const (
DefaultIterationLimit = 50
)
Variables ¶
View Source
var ( ErrNotOk = errors.New("not ok") ErrBadReply = errors.New("bad reply") ErrNoPool = errors.New("no connection pool") )
View Source
var (
ErrInvalidCacheKey = errors.New("invalid cache key")
)
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Redis *Redis // contains filtered or unexported fields }
func (*Cache) SearchMaxIter ¶
type DeleteErrors ¶
func (*DeleteErrors) Add ¶
func (e *DeleteErrors) Add(key string, err error)
func (*DeleteErrors) Error ¶
func (e *DeleteErrors) Error() string
type Redis ¶
func (*Redis) DeleteKeyMatchFn ¶
func (*Redis) ScanAtLeast ¶
ScanAtLeast will scan until the first cursor that the limit is reached. It will return the found keys at that limit.
func (*Redis) ScanAtLeastWithMaxIter ¶
func (r *Redis) ScanAtLeastWithMaxIter(match string, cursor, limit int, maxIter int) ([]string, int, error)
ScanAtLeastWithMaxIter tries to scan at least a certain amount of records, but will stop with the max number of empty scans reaches a certain point.
func (*Redis) ScanIterate ¶
func (*Redis) Set ¶
NOTICE: https://redis.io/commands/set Since the SET command options can replace SETNX, SETEX, PSETEX, GETSET, it is possible that in future versions of Redis these three commands will be deprecated and finally removed.
Hence, let's not implement them. - Tom
Click to show internal directories.
Click to hide internal directories.