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)
| 51 | // the YAML spec) into its own chunk, converting it to JSON via |
| 52 | // yaml.YAMLToJSON, and then passing it to json.Decoder. |
| 53 | func 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 |