Documentation ¶
Overview ¶
Package cachingtest contains helpers for testing code that uses caching package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithGlobalCache ¶
WithGlobalCache installs given BlobCaches as "global" in the context.
'caches' is a map from a namespace to BlobCache instance. If some other namespace is requested, the corresponding caching.GlobalCache call will panic.
Types ¶
type BlobCache ¶
type BlobCache struct { LRU *lru.Cache // underlying LRU cache, create it with lru.New(capacity). Err error // if non-nil, will be returned by Get and Set }
BlobCache implements caching.BlobCache on top of lru.Cache for testing.
Useful for mocking caching.GlobalCache in tests. See also WithGlobalCache below.
Click to show internal directories.
Click to hide internal directories.