Documentation ¶
Overview ¶
Package cache provides a cached Image Provider
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheKeyGenerator ¶
type CacheKeyGenerator interface {
GetKey(source interface{}, parameters imageserver.Parameters) string
}
CacheKeyGenerator generates a Cache Key
type CacheKeyGeneratorFunc ¶
type CacheKeyGeneratorFunc func(source interface{}, parameters imageserver.Parameters) string
CacheKeyGeneratorFunc is a CacheKeyGenerator func
func NewSourceHashCacheKeyGeneratorFunc ¶
func NewSourceHashCacheKeyGeneratorFunc(newHashFunc func() hash.Hash) CacheKeyGeneratorFunc
NewSourceHashCacheKeyGeneratorFunc returns a CacheKeyGeneratorFunc that hashes the source
func (CacheKeyGeneratorFunc) GetKey ¶
func (f CacheKeyGeneratorFunc) GetKey(source interface{}, parameters imageserver.Parameters) string
GetKey calls the func
type CacheProvider ¶
type CacheProvider struct { imageserver.Provider imageserver_cache.Cache CacheKeyGenerator }
CacheProvider represents a cached Image Provider
func (*CacheProvider) Get ¶
func (provider *CacheProvider) Get(source interface{}, parameters imageserver.Parameters) (*imageserver.Image, error)
Get returns an Image for a source
It caches the image. The cache key used is a sha256 of the source's string representation.
Click to show internal directories.
Click to hide internal directories.