Documentation ¶
Index ¶
Constants ¶
View Source
const ( MEMCACHED string = "memcached" REDIS string = "redis" )
The backend store name
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, creator StoreCreator)
Register makes a store creator available by name.
Types ¶
type Config ¶
type Config struct { Timeout time.Duration Addr string // The address of the backend store with "host:port" format Password string // The authority password if necessarily }
Config contains the options for a storage client
type Store ¶
type Store interface { // Get gets a value by key // If the key is not found in the store, the Err is nil and Value is empty Get(key string) GetResult // MultiGet is a batch version of Get MultiGet(keys []string) map[string]GetResult // Set sets a value with key where the key exists or not Set(key, value string) error // Delete deletes a key/value pair from the store Delete(key string) error }
type StoreCreator ¶
StoreCreator is a function to create a new instance of Store
Click to show internal directories.
Click to hide internal directories.