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

Method get

kv/memberlist/memberlist_client.go:1044–1056  ·  view source on GitHub ↗

Returns current value with removed tombstones.

(key string, _ codec.Codec)

Source from the content-addressed store, hash-verified

1042
1043// Returns current value with removed tombstones.
1044func (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.

Callers 4

GetMethod · 0.95
WatchKeyMethod · 0.95
WatchPrefixMethod · 0.95
trySingleCasMethod · 0.95

Calls 2

CloneMethod · 0.65
RemoveTombstonesMethod · 0.65

Tested by

no test coverage detected