yaml

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIndent

func AddIndent(src []byte, indent int) (dst []byte)

func AddOrReplace

func AddOrReplace(src []byte, key string, value any, nodeParent *yaml.Node) ([]byte, error)

func AddPrefix

func AddPrefix(src, pre []byte) (dst []byte)

func AddToEnd

func AddToEnd(src []byte, key string, value any, path ...string) ([]byte, error)

func Encode

func Encode(v any, indent int) ([]byte, error)

func FindChild

func FindChild(node *yaml.Node, name string) (key, value *yaml.Node)

FindChild - search and return YAML key/value pair for current Node

func FindParent

func FindParent(src []byte, path ...string) (*yaml.Node, error)

FindParent - return YAML Node from path of keys (tree)

func FirstChild

func FirstChild(node *yaml.Node) *yaml.Node

func LastChild

func LastChild(node *yaml.Node) *yaml.Node

func LineOffset

func LineOffset(b []byte, line int) (offset int)

func Patch

func Patch(src []byte, key string, value any, path ...string) ([]byte, error)

Patch - change key/value pair in YAML file without break formatting

func Unmarshal

func Unmarshal(in []byte, out interface{}) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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