yamlprocessor

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValue

func GetValue(yml []byte, path string) (interface{}, error)

GetValue gives back the value placed at a given path. The type of returned value can be string, int64, uint64, float64, bool, and []interface{}.

The path requires to start with "$" which represents the root element. Available operators are: $ : the root object/element . : child operator .. : recursive descent [num] : object/element of array by number [*] : all objects/elements for array.

e.g. "$.foo.bar[0].baz"

func ReplaceValue

func ReplaceValue(yml []byte, path string, value string) ([]byte, error)

ReplaceValue replaces the value placed at a given path with a given value, and then gives back the new yaml bytes.

For available operators for the path, see GetValue().

Types

This section is empty.

Jump to

Keyboard shortcuts

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