yamlnode

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteMappingKey

func DeleteMappingKey(mapping *yaml.Node, key string)

DeleteMappingKey removes all entries for key from a YAML mapping node.

func DocumentMapping

func DocumentMapping(doc *yaml.Node) *yaml.Node

DocumentMapping returns the document's mapping root when present.

func EmptyDocument

func EmptyDocument() *yaml.Node

EmptyDocument returns a YAML document with an empty mapping root.

func EnsureDocumentMapping

func EnsureDocumentMapping(doc *yaml.Node) *yaml.Node

EnsureDocumentMapping ensures doc is a YAML document with a mapping root.

func EnsureMappingValue

func EnsureMappingValue(mapping *yaml.Node, key string) *yaml.Node

EnsureMappingValue ensures key exists as a mapping value below mapping.

func IntValue

func IntValue(node *yaml.Node) int

IntValue parses a scalar integer value, returning zero on absence or parse failure.

func MappingValue

func MappingValue(mapping *yaml.Node, key string) *yaml.Node

MappingValue returns the value for key in a YAML mapping node.

func ScalarValue

func ScalarValue(node *yaml.Node) string

ScalarValue returns a trimmed scalar node value.

func SetMappingValue

func SetMappingValue(mapping *yaml.Node, key string, value *yaml.Node)

SetMappingValue replaces or appends key with value in a YAML mapping node.

func StringFieldValues

func StringFieldValues(node *yaml.Node) []string

StringFieldValues returns shell-like fields from scalar nodes and raw scalar values from sequence nodes. It is useful for Docker Compose command fields, which can be a block/scalar command string or an argv-style sequence.

func StringValues

func StringValues(node *yaml.Node) []string

StringValues returns scalar values from a scalar or sequence node.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL