Documentation
¶
Index ¶
- func EncodeMD5(str string) string
- func Register(name string, adapter CacheStore)
- func Version() string
- type Cache
- type CacheStore
- type Engine
- func (this *Engine) Decr(key string) (int64, error)
- func (this *Engine) Delete(key string) error
- func (this *Engine) Flush() error
- func (this *Engine) Get(key string) string
- func (this *Engine) Incr(key string) (int64, error)
- func (this *Engine) MGet(keys []string) []string
- func (this *Engine) MSet(items map[string]string, timeout int64) error
- func (this *Engine) Set(key, val string, timeout int64) error
- func (this *Engine) StartAndGC(opt Options) error
- func (this *Engine) Tags(tags []string) Cache
- func (this *Engine) Touch(key string, expire int64) error
- type Options
- type TagCache
- func (this *TagCache) Decr(key string) (int64, error)
- func (this *TagCache) Delete(key string) error
- func (this *TagCache) Flush() error
- func (this *TagCache) Get(key string) string
- func (this *TagCache) Incr(key string) (int64, error)
- func (this *TagCache) MGet(keys []string) []string
- func (this *TagCache) MSet(items map[string]string, expire int64) error
- func (this *TagCache) Set(key, value string, expire int64) error
- func (this *TagCache) StartAndGC(opt Options) error
- func (this *TagCache) TaggedItemKey(key string) string
- func (this *TagCache) Tags(tags []string) Cache
- func (this *TagCache) Touch(key string, expire int64) error
- type TagSet
- func (this *TagSet) AddNames(names []string)
- func (this *TagSet) GetNamespace() string
- func (this *TagSet) Reset() error
- func (this *TagSet) ResetTag(name string) string
- func (this *TagSet) SetNames(names []string)
- func (this *TagSet) TagId(name string) string
- func (this *TagSet) TagIds() []string
- func (this *TagSet) TagKey(name string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { CacheStore Tags(tags []string) Cache }
func NewTagCache ¶
func NewTagCache(store CacheStore, names ...string) Cache
type CacheStore ¶
type CacheStore interface { // Set Sets value into cache with key and expire time. Set(key, val string, timeout int64) error MSet(items map[string]string, timeout int64) error // Get gets cached value by given key. Get(key string) string // Get Multi keys MGet(keys []string) []string // Delete deletes cached value by given key. Delete(key string) error // Incr increases cached int-type value by given key as a counter. Incr(key string) (int64, error) // Decr decreases cached int-type value by given key as a counter. Decr(key string) (int64, error) // Flush deletes all cached data. Flush() error // StartAndGC starts GC routine based on config string settings. StartAndGC(opt Options) error // update expire time Touch(key string, expire int64) error }
Cache is the interface that operates the cache data.
type Engine ¶
type Engine struct { Opt Options // contains filtered or unexported fields }
func (*Engine) StartAndGC ¶
type TagCache ¶
type TagCache struct {
// contains filtered or unexported fields
}
func (*TagCache) StartAndGC ¶
func (*TagCache) TaggedItemKey ¶
Click to show internal directories.
Click to hide internal directories.