Documentation ¶
Index ¶
- Constants
- Variables
- func CacheTimeNow() int64
- func DDEL(key []byte) bool
- func DEL(key []byte) bool
- func DFDEL(key, fld []byte) bool
- func DFGET(key, fld []byte) ([]byte, bool)
- func DFSET(key, fld, val []byte, ttl int) bool
- func DGET(key []byte) (map[string][]byte, bool)
- func DKEYS() []string
- func DLEN() int
- func DTTL(key []byte) int
- func GET(key []byte) ([]byte, bool)
- func Init()
- func KEYS() []string
- func LDEL(key []byte) bool
- func LEN() int
- func LGET(key []byte) ([][]byte, bool)
- func LKEYS() []string
- func LLEN() int
- func LPOP(key []byte) ([]byte, bool)
- func LPUSH(key, val []byte, ttl int) bool
- func LTTL(key []byte) int
- func SET(key, val []byte, ttl int) bool
- func TTL(key []byte) int
- type Atomic
- type CacheType
- type Dic
- type DicCache
- type List
- type ListCache
- type String
- type StringCache
Constants ¶
View Source
const ( // TTL codes KeyTTLErrCode = -3 KeyNotExistCode = -2 KeyHasNoTTLCode = -1 // cache types STRING_CACHE CacheType = iota + 1 LIST_CACHE DIC_CACHE )
Variables ¶
View Source
var ( // prepare byte slices for common ttl responses TtlKeyCodes = map[int][]byte{ KeyTTLErrCode: []byte("-3"), KeyNotExistCode: []byte("-2"), KeyHasNoTTLCode: []byte("-1"), } )
Functions ¶
func CacheTimeNow ¶
func CacheTimeNow() int64
func DGET ¶
DGET returns map[string][]byte of values in Dic by key, nil, false if not exists or expired
func LGET ¶
LGET returns [][]byte of values stored in List by a key, return nil, false if not exists or key is nil
func LPOP ¶
LPOP returns and removes first element in list if it was last element, list item deleted from cache returns nil, false if not exist
Types ¶
type Dic ¶
type Dic struct {
// contains filtered or unexported fields
}
Dic cache item struct
type DicCache ¶
type DicCache struct {
// contains filtered or unexported fields
}
DicCache is bucket holding list of caches in stripped map
type List ¶
type List struct {
// contains filtered or unexported fields
}
List cache item struct
type ListCache ¶
type ListCache struct {
// contains filtered or unexported fields
}
ListCache is bucket holding list caches in stripped map
type String ¶
type String struct {
// contains filtered or unexported fields
}
String cache item struct
type StringCache ¶
type StringCache struct {
// contains filtered or unexported fields
}
StringCache is bucket holding string caches in stripped map
Click to show internal directories.
Click to hide internal directories.