newMockKV creates an in-memory implementation of an etcd client
()
| 41 | |
| 42 | // newMockKV creates an in-memory implementation of an etcd client |
| 43 | func 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 | // |
no outgoing calls