package kv
|
|
|
|
const DefaultExpireVal int64 = 1800
|
|
|
|
type KV interface {
|
|
Keys(p string) ([]string, error)
|
|
// Get Cached bytes via k, return empty bytes and false if failed.
|
|
Get(k string) ([]byte, error)
|
|
// Set bytes to cache with given key
|
|
Set(k string, d []byte, x ...int64) error
|
|
//
|
|
GetJSON(k string, o interface{}) error
|
|
//
|
|
SetJSON(k string, v interface{}, x ...int64) error
|
|
//
|
|
GetBSON(k string, o interface{}) error
|
|
//
|
|
SetBSON(k string, v interface{}, x ...int64) error
|
|
//
|
|
Del(k ...string) error
|
|
//
|
|
Expire(k string, x ...int64) error
|
|
}
|