Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCleanTask ¶
func TotalWeights ¶
Types ¶
type Cache ¶
type Cache interface { DelCache(keys ...string) error GetCache(key string, v interface{}) error SetCache(key string, v interface{}) error SetCacheWithExpire(key string, v interface{}, expire time.Duration) error Take(v interface{}, key string, query func(v interface{}) error) error TakeWithExpire(v interface{}, key string, query func(v interface{}, expire time.Duration) error) error }
func NewCache ¶
func NewCache(c ClusterConf, barrier syncx.SharedCalls, st *CacheStat, errNotFound error, opts ...Option) Cache
func NewCacheNode ¶
type CacheStat ¶
type CacheStat struct { // export the fields to let the unit tests working, // reside in internal package, doesn't matter. Total uint64 Hit uint64 Miss uint64 DbFails uint64 // contains filtered or unexported fields }
func NewCacheStat ¶
func (*CacheStat) IncrementDbFails ¶
func (cs *CacheStat) IncrementDbFails()
func (*CacheStat) IncrementHit ¶
func (cs *CacheStat) IncrementHit()
func (*CacheStat) IncrementMiss ¶
func (cs *CacheStat) IncrementMiss()
func (*CacheStat) IncrementTotal ¶
func (cs *CacheStat) IncrementTotal()
type ClusterConf ¶
type ClusterConf []NodeConf
Click to show internal directories.
Click to hide internal directories.