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

Method Unmarshal

ring/tokens.go:98–105  ·  view source on GitHub ↗

Unmarshal reads the tokens from JSON byte stream.

(b []byte)

Source from the content-addressed store, hash-verified

96
97// Unmarshal reads the tokens from JSON byte stream.
98func (t *Tokens) Unmarshal(b []byte) error {
99 tj := tokensJSON{}
100 if err := json.Unmarshal(b, &tj); err != nil {
101 return err
102 }
103 *t = tj.Tokens
104 return nil
105}
106
107type tokensJSON struct {
108 Tokens []uint32 `json:"tokens"`

Callers 2

TestTokens_SerializationFunction · 0.95
LoadTokensFromFileFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestTokens_SerializationFunction · 0.76