func NewYAMLToJSONDecoder(r io.Reader) *YAMLToJSONDecoder {
	scanner := bufio.NewScanner(r)
	scanner.Split(splitYAMLDocument)
	return &YAMLToJSONDecoder{
		scanner: scanner,
	}
}
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.
package yaml
import (
	"bufio"
	"bytes"
	"encoding/json"
	"io"
	"unicode"
	"github.com/ghodss/yaml"
	"github.com/golang/glog"
)
type YAMLToJSONDecoder struct {
	scanner *bufio.Scanner
}