Documentation ¶
Overview ¶
Package cache contains caching implementation for retrieved data
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotFound = errors.New("requested key was not found in database")
ErrKeyNotFound signalized the key is not present in the cache
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(namespace, key string) (value string, err error) Set(namespace, key, value string, ttl time.Duration) (err error) Delete(namespace, key string) (err error) }
Cache describes an interface used to store generated data
func GetCacheByURI ¶
GetCacheByURI instantiates a new Cache by the given URI string
type InMemCache ¶
type InMemCache struct {
// contains filtered or unexported fields
}
InMemCache implements the Cache interface for storage in memory
func (*InMemCache) Delete ¶
func (i *InMemCache) Delete(namespace, key string) (err error)
Delete deletes data
Click to show internal directories.
Click to hide internal directories.