MCPcopy Create free account
hub / github.com/IBM/newrelic-cli / NewYAMLToJSONDecoder

Function NewYAMLToJSONDecoder

utils/decoder.go:53–58  ·  view source on GitHub ↗

NewYAMLToJSONDecoder decodes YAML documents from the provided stream in chunks by converting each document (as defined by the YAML spec) into its own chunk, converting it to JSON via yaml.YAMLToJSON, and then passing it to json.Decoder.

(r io.Reader)

Source from the content-addressed store, hash-verified

51// the YAML spec) into its own chunk, converting it to JSON via
52// yaml.YAMLToJSON, and then passing it to json.Decoder.
53func NewYAMLToJSONDecoder(r io.Reader) *YAMLToJSONDecoder {
54 reader := bufio.NewReader(r)
55 return &YAMLToJSONDecoder{
56 reader: NewYAMLReader(reader),
57 }
58}
59
60// Decode reads a YAML document as JSON from the stream or returns
61// an error. The decoding rules match json.Unmarshal, not

Callers 1

DecodeMethod · 0.85

Calls 1

NewYAMLReaderFunction · 0.85

Tested by

no test coverage detected