Documentation ¶
Overview ¶
Package _test provides utilities for imageserver/cache.Cache testing.
Index ¶
Constants ¶
View Source
const ( // KeyValid is a valid Cache key (with content) KeyValid = "test" // KeyMiss is an invalid Cache key (without content) KeyMiss = "unknown" )
Variables ¶
This section is empty.
Functions ¶
func BenchmarkGet ¶
func BenchmarkGet(b *testing.B, cache imageserver_cache.Cache, parallelism int, im *imageserver.Image)
BenchmarkGet is a helper to benchmark imageserver/cache.Cache.Get().
func TestGetMiss ¶
func TestGetMiss(t *testing.T, cache imageserver_cache.Cache)
TestGetMiss is a helper to test imageserver/cache.Cache.Get() with a "cache miss".
func TestGetSet ¶
func TestGetSet(t *testing.T, cache imageserver_cache.Cache)
TestGetSet is a helper to test imageserver/cache.Cache.Get()/Set().
Types ¶
type MapCache ¶
type MapCache struct {
// contains filtered or unexported fields
}
MapCache is a simple imageserver/cache.Cache implementation (it wraps a map) for tests.
func (*MapCache) Get ¶
func (cache *MapCache) Get(key string, params imageserver.Params) (*imageserver.Image, error)
Get implements imageserver/cache.Cache.
func (*MapCache) Set ¶
func (cache *MapCache) Set(key string, im *imageserver.Image, params imageserver.Params) error
Set implements imageserver/cache.Cache.
Click to show internal directories.
Click to hide internal directories.