MCPcopy Create free account
hub / github.com/prometheus/common / NewDecoder

Function NewDecoder

expfmt/decode.go:75–81  ·  view source on GitHub ↗

NewDecoder returns a new decoder based on the given input format. If the input format does not imply otherwise, a text format decoder is returned.

(r io.Reader, format Format)

Source from the content-addressed store, hash-verified

73// NewDecoder returns a new decoder based on the given input format.
74// If the input format does not imply otherwise, a text format decoder is returned.
75func NewDecoder(r io.Reader, format Format) Decoder {
76 switch format {
77 case FmtProtoDelim:
78 return &protoDecoder{r: r}
79 }
80 return &textDecoder{r: r}
81}
82
83// protoDecoder implements the Decoder interface for protocol buffers.
84type protoDecoder struct {

Callers 1

Calls

no outgoing calls

Tested by 1