MCPcopy
hub / github.com/grafana/tempo / unmarshal

Method unmarshal

tempodb/backend/tenantindex.go:56–65  ·  view source on GitHub ↗

unmarshal decompresses and unmarshals the results from json

(buffer []byte)

Source from the content-addressed store, hash-verified

54
55// unmarshal decompresses and unmarshals the results from json
56func (b *TenantIndex) unmarshal(buffer []byte) error {
57 gzipReader, err := gzip.NewReader(bytes.NewReader(buffer))
58 if err != nil {
59 return err
60 }
61 defer gzipReader.Close()
62
63 d := json.NewDecoder(gzipReader)
64 return d.Decode(b)
65}
66
67func (b *TenantIndex) marshalPb() ([]byte, error) {
68 pbBytes, err := proto.Marshal(b)

Callers 5

TenantIndexMethod · 0.95
TestWriterFunction · 0.95
TestIndexUnmarshalErrorsFunction · 0.95
BenchmarkIndexUnmarshalFunction · 0.80

Calls 2

DecodeMethod · 0.95
CloseMethod · 0.65

Tested by 4

TestWriterFunction · 0.76
TestIndexUnmarshalErrorsFunction · 0.76
BenchmarkIndexUnmarshalFunction · 0.64