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

Function NewSegmentDecoder

pkg/model/segment_decoder.go:35–44  ·  view source on GitHub ↗

NewSegmentDecoder returns a Decoder given the passed string.

(dataEncoding string)

Source from the content-addressed store, hash-verified

33
34// NewSegmentDecoder returns a Decoder given the passed string.
35func NewSegmentDecoder(dataEncoding string) (SegmentDecoder, error) {
36 switch dataEncoding {
37 case v1.Encoding:
38 return v1.NewSegmentDecoder(), nil
39 case v2.Encoding:
40 return v2.NewSegmentDecoder(), nil
41 }
42
43 return nil, fmt.Errorf("unknown encoding %s. Supported encodings %v", dataEncoding, AllEncodings)
44}
45
46// MustNewSegmentDecoder creates a new encoding or it panics
47func MustNewSegmentDecoder(dataEncoding string) SegmentDecoder {

Calls 2

NewSegmentDecoderFunction · 0.92
NewSegmentDecoderFunction · 0.92