cache

package
v0.0.0-...-0345585 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2014 License: MIT Imports: 6 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL