Documentation
¶
Index ¶
- Variables
- type Cache
- func (c *Cache) Delete(key string) error
- func (c *Cache) DeleteAllByTag(tagName string) error
- func (c *Cache) Get(key string) ([]byte, error)
- func (c *Cache) GetAllByTag(tag string) ([][]byte, error)
- func (c *Cache) Set(key string, value []byte) error
- func (c *Cache) SetWithTags(key string, value []byte, tags ...string) error
- func (c *Cache) Stop() error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("item not found")
)
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Delete ¶
Delete deletes the item identified by key in the cache. No error is returned if the item does not exist in the cache.
func (*Cache) DeleteAllByTag ¶
DeleteAllByTag deletes all items in the cache that have been tagged by tagName. Deletes an item even if multiple tags refer to it.
func (*Cache) Get ¶
Get returns the item identified by key from the cache. It returns ErrNotFound if the item doesn't exist in the cache.
func (*Cache) GetAllByTag ¶
GetAllByTag returns the values of all items tagged with tag.
func (*Cache) SetWithTags ¶
SetWithTags adds the item identified by key with value to the cache. One or more tags can be passed to tag the item.
Click to show internal directories.
Click to hide internal directories.