yamlprocessor

package
v0.47.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor(data []byte) (*Processor, error)

func (*Processor) Bytes

func (p *Processor) Bytes() []byte

func (*Processor) GetValue

func (p *Processor) GetValue(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 and bool.

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

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

func (*Processor) ReplaceString

func (p *Processor) ReplaceString(path, value string) error

ReplaceString replaces the value placed at a given path with a given string value.

Jump to

Keyboard shortcuts

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