Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCacheMiss = errors.New("cache miss") ErrNotFound = errors.New("not found") ErrExpired = errors.New("expired") ErrInternal = errors.New("internal error") )
Errors
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Put(key string, value interface{}) error PutUntil(time time.Time, key string, value interface{}) error Get(key string) (interface{}, error) Delete(key string) error Keys() []string }
Cache describes very simple TTL cache interface.
func NewBoltDBCache ¶
NewBoltDBCache implementes Cache with a BoltDB back-end;
func NewMemoryCache ¶
func NewMemoryCache() Cache
NewMemoryCache implementes Cache with an in-memory store
Click to show internal directories.
Click to hide internal directories.