Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCleanTask ¶ added in v1.0.18
func TotalWeights ¶ added in v1.0.18
Types ¶
type Cache ¶ added in v1.0.18
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 ¶ added in v1.0.18
func NewCache(c ClusterConf, barrier syncx.SharedCalls, st *CacheStat, errNotFound error, opts ...Option) Cache
func NewCacheNode ¶ added in v1.0.18
type CacheConf ¶
type CacheConf = ClusterConf
type CacheStat ¶ added in v1.0.18
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 ¶ added in v1.0.18
func (*CacheStat) IncrementDbFails ¶ added in v1.0.18
func (cs *CacheStat) IncrementDbFails()
func (*CacheStat) IncrementHit ¶ added in v1.0.18
func (cs *CacheStat) IncrementHit()
func (*CacheStat) IncrementMiss ¶ added in v1.0.18
func (cs *CacheStat) IncrementMiss()
func (*CacheStat) IncrementTotal ¶ added in v1.0.18
func (cs *CacheStat) IncrementTotal()
type ClusterConf ¶ added in v1.0.18
type ClusterConf []NodeConf
Click to show internal directories.
Click to hide internal directories.