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

Function newMockKV

kv/etcd/mock.go:43–53  ·  view source on GitHub ↗

newMockKV creates an in-memory implementation of an etcd client

()

Source from the content-addressed store, hash-verified

41
42// newMockKV creates an in-memory implementation of an etcd client
43func newMockKV() *mockKV {
44 kv := &mockKV{
45 values: make(map[string]mvccpb.KeyValue),
46 valuesMtx: sync.Mutex{},
47 close: make(chan struct{}),
48 events: make(map[chan clientv3.Event]struct{}),
49 eventsMtx: sync.Mutex{},
50 }
51
52 return kv
53}
54
55// mockKV is an in-memory implementation of an Etcd client.
56//

Callers 6

NewInMemoryClientFunction · 0.85
TestMockKv_GetFunction · 0.85
TestMockKV_PutFunction · 0.85
TestMockKV_DeleteFunction · 0.85
TestMockKV_TxnFunction · 0.85
TestMockKV_WatchFunction · 0.85

Calls

no outgoing calls

Tested by 5

TestMockKv_GetFunction · 0.68
TestMockKV_PutFunction · 0.68
TestMockKV_DeleteFunction · 0.68
TestMockKV_TxnFunction · 0.68
TestMockKV_WatchFunction · 0.68