Documentation ¶
Index ¶
- func Clear() error
- func Delete(key string) error
- func DeleteMultiple(keys ...string) error
- func Get(key string) ([]byte, error)
- func GetD(key string, v []byte) []byte
- func GetMultiple(keys ...string) (map[string][]byte, error)
- func Has(key string) (bool, error)
- func Register(c Cacher)
- func Set(key string, val []byte) error
- func SetMultiple(values map[string][]byte) error
- func SetWithTTL(key string, val []byte, ttl int64) error
- type Cacher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteMultiple ¶
DeleteMultiple delete multiple value
func GetMultiple ¶
GetMultiple get multiple value
Types ¶
type Cacher ¶
type Cacher interface { //get a value Get(key string) ([]byte, error) //get a value from cache with default GetD(key string, v []byte) []byte //set a value to cache Set(key string, val []byte) error //set a value with ttl SetWithTTL(key string, val []byte, ttl int64) error //check the value is exist Has(key string) (bool, error) //delete a value Delete(key string) error //clear all the values Clear() error //get multi values GetMultiple(keys ...string) (map[string][]byte, error) //set multi values with [key]value SetMultiple(values map[string][]byte) error //delete multi values DeleteMultiple(keys ...string) error }
Cacher define an cache interface
Click to show internal directories.
Click to hide internal directories.