Returns current value with removed tombstones.
(key string, _ codec.Codec)
| 1042 | |
| 1043 | // Returns current value with removed tombstones. |
| 1044 | func (m *KV) get(key string, _ codec.Codec) (out interface{}, version uint, err error) { |
| 1045 | m.storeMu.Lock() |
| 1046 | v := m.store[key].Clone() |
| 1047 | m.storeMu.Unlock() |
| 1048 | |
| 1049 | if v.value != nil { |
| 1050 | // remove ALL tombstones before returning to client. |
| 1051 | // No need for clients to see them. |
| 1052 | _, _ = v.value.RemoveTombstones(time.Time{}) |
| 1053 | } |
| 1054 | |
| 1055 | return v.value, v.Version, nil |
| 1056 | } |
| 1057 | |
| 1058 | // WatchKey watches for value changes for given key. When value changes, 'f' function is called with the |
| 1059 | // latest value. Notifications that arrive while 'f' is running are coalesced into one subsequent 'f' call. |
no test coverage detected