Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRedisDSN ¶ added in v1.2.0
func RegisterCacheDriver ¶
func RegisterCacheDriver(driverName string, creator CacheCreator)
Types ¶
type CacheConfig ¶
type CacheCreator ¶
type CacheCreator func(config *CacheConfig) Cacher
func CacheDriver ¶
func CacheDriver(driver string) (CacheCreator, bool)
type Cacher ¶
type Cacher interface { // update value's expire time to timeout Touch(key string, timeout time.Duration) error // Get cached value by key. Get(key string) (interface{}, error) // Put cached value with key and expire time. Put(key string, val interface{}, timeout time.Duration) error // Increment cached int value by key, as a counter. Increment(key string) error // Decrement cached int value by key, as a counter. Decrement(key string) error // Delete cached value by key. Delete(key string) error // Clear all cache. ClearAll() error // Get cached Json value by key. GetJson(key string, val interface{}) error // Put Json value with key and expire time PutJson(key string, val interface{}, timeout time.Duration) error }
Click to show internal directories.
Click to hide internal directories.