Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node interface { Type() TypeID // Tag returns a YAML tag if any. Tag() string // Contents returns the contents as further Node items. For maps, this will contain exactly two nodes, while // for sequences this will contain as many nodes as there are items. For strings, this will contain no items. Contents() []Node // MapKey selects a specific map key. Returns the node and a bool that represents whether the key was present. // If the node is not a map, this function panics. MapKey(key string) (Node, bool) // MapKeys lists all keys of a map. If the node is not a map, this function panics. MapKeys() []string // Value returns the value in case of a string node. Value() string // Raw outputs the node as raw data without type annotation. Raw() any }
Node is a simplified representation of a YAML node.
type Parser ¶
type Parser interface { // Parse parses the provided value into the simplified node representation. Parse(data []byte) (Node, error) }
Parser is a YAML parser that parses into a simplified value structure.
type TypeID ¶
type TypeID string
TypeID represents the value structure in accordance with the YAML specification 10.1.1. See https://yaml.org/spec/1.2.2/#101-failsafe-schema for details.
const ( // TypeIDMap is a generic map in accordance with the YAML specification 10.1.1.1. TypeIDMap TypeID = "map" // TypeIDSequence is a generic sequence in accordance with YAML specification 10.1.1.2. TypeIDSequence TypeID = "seq" // TypeIDString is a generic string in accordance with YAML specification 10.1.1.3. TypeIDString TypeID = "str" )
Click to show internal directories.
Click to hide internal directories.