Documentation
¶
Overview ¶
Package yaml provides YAML <-> JSON conversion for OPA, on top of go.yaml.in/yaml/v3.
It replaces sigs.k8s.io/yaml, which is pinned to go.yaml.in/yaml/v2 and therefore resolves YAML 1.1 boolean spellings (on/off/yes/no) in positions where the YAML 1.2 core schema calls for strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONToYAML ¶
JSONToYAML converts JSON to YAML, preserving nothing but the value.
func Marshal ¶
Marshal serializes obj as YAML. obj is first round-tripped through encoding/json so that `json` struct tags and json.Marshaler implementations are honoured, matching the behaviour callers relied on from sigs.k8s.io/yaml.
func Unmarshal ¶
Unmarshal decodes a YAML document into obj, using encoding/json semantics (`json` struct tags, json.Unmarshaler) rather than go-yaml's.
func YAMLToJSON ¶
YAMLToJSON converts a single YAML document to JSON. Input holding more than one document keeps its historical meaning - only the first is converted - but the rest of the stream still has to parse.