Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Clear() error
- func (c *Cache) Decrease(key string) error
- func (c *Cache) Delete(key string) error
- func (c *Cache) Get(key string, dst interface{}) error
- func (c *Cache) GetMulti(dict map[string]interface{}) (notFound []string, err error)
- func (c *Cache) Increase(key string) error
- func (c *Cache) IsExists(key string) (bool, error)
- func (c *Cache) Set(key string, value interface{}, duration time.Duration) error
- func (c *Cache) Stop()
- type Options
- type Sized
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { Options // contains filtered or unexported fields }
type Options ¶
type Options struct { // Max size of cache MaxSize int64 // Bucket count (2 ^ n). Default 4 Buckets uint8 // The number of items to prune when memory is low. Default 500 ItemsToPrune uint32 // The size of the queue for items which should be deleted. If the queue fills // up, calls to Delete() will block. Default 1024 DeleteBuffer uint32 // The size of the queue for items which should be promotes. If the queue fills // up, calls to Get/Set/GetMulti/IsExists() will block. Default 1024 PromoteBuffer uint32 // Give a large cache with a high read / write ratio, it's usually unnecessary // to promote an item on every Get. GetsPerPromote specifies the number of Gets // a key must have before being promoted. Default 3 GetsPerPromote int32 }
Click to show internal directories.
Click to hide internal directories.