Documentation ¶
Overview ¶
Package memory provides an in-memory Image Cache
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache represents an in-memory Image Cache
It uses an LRU implementation from https://github.com/pierrre/lrucache (copy of https://github.com/youtube/vitess/tree/master/go/cache)
func New ¶
func New(capacity int64) *MemoryCache
New creates a MemoryCache
capacity is the maximum cache size (in bytes)
func (*MemoryCache) Get ¶
func (cache *MemoryCache) Get(key string, parameters imageserver.Parameters) (*imageserver.Image, error)
Get gets an image from the in-memory Cache
func (*MemoryCache) Set ¶
func (cache *MemoryCache) Set(key string, image *imageserver.Image, parameters imageserver.Parameters) error
Set sets an Image to the in-memory Cache
Click to show internal directories.
Click to hide internal directories.