MCPcopy
hub / github.com/grafana/dskit / NewErroringMockCache

Function NewErroringMockCache

cache/mock.go:226–231  ·  view source on GitHub ↗

NewErroringMockCache creates a new ErroringMockCache with the given error.

(err error)

Source from the content-addressed store, hash-verified

224
225// NewErroringMockCache creates a new ErroringMockCache with the given error.
226func NewErroringMockCache(err error) *ErroringMockCache {
227 return &ErroringMockCache{
228 MockCache: NewMockCache(),
229 GetMultiErr: err,
230 }
231}
232
233func (m *ErroringMockCache) GetMulti(ctx context.Context, keys []string, opts ...Option) map[string][]byte {
234 result, _ := m.GetMultiWithError(ctx, keys, opts...)

Callers 3

TestVersionedFunction · 0.85
TestSnappyCacheFunction · 0.85

Calls 1

NewMockCacheFunction · 0.85

Tested by 3

TestVersionedFunction · 0.68
TestSnappyCacheFunction · 0.68