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

Method Iter

tenant/metadata.go:153–162  ·  view source on GitHub ↗

Iter returns a new iterator that yields key/value pairs sorted by keys. It doesn't allocate.

()

Source from the content-addressed store, hash-verified

151//
152// It doesn't allocate.
153func (m Metadata) Iter() iter.Seq2[string, string] {
154 return func(yield func(string, string) bool) {
155 for sub := range m.Divide() {
156 k, v, _ := stringsCut(sub.Encode()[1:], metadataKVSeparator)
157 if !yield(k, v) {
158 return
159 }
160 }
161 }
162}
163
164// Set a key value pair.
165//

Callers 3

SetMethod · 0.95
GetMethod · 0.95
TestMetadata_DivideIterFunction · 0.95

Calls 3

DivideMethod · 0.95
stringsCutFunction · 0.85
EncodeMethod · 0.65

Tested by 1

TestMetadata_DivideIterFunction · 0.76