Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Get gets the value of the given key. // If the key does not exist, the returned string will be empty (""). Get(ctx context.Context, key string) (string, error) // SetIfNotExists set key to hold string value if key does not exist (returning true). // If key exists, no operation is performed and false is returned as a result. // An expiration for the key has to be set. Zero expiration means the key is there forever. SetIfNotExists( ctx context.Context, key string, value string, expiration time.Duration, ) (bool, error) }
A Cache exposes functions from an in-memory store
func NewMiniredis ¶
func NewMiniredis() (*miniredis.Miniredis, Cache)
NewMiniredis returns a miniredis and Cache instance for test purposes
Click to show internal directories.
Click to hide internal directories.