emrichen

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 19 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenericMapToNode

func GenericMapToNode(mapValue reflect.Value) (*yaml.Node, error)

func GenericSliceToNode

func GenericSliceToNode(slice reflect.Value) (*yaml.Node, error)

func NodeToBool

func NodeToBool(node *yaml.Node) (bool, bool)

NodeToBool parses a YAML node to bool.

func NodeToFloat

func NodeToFloat(node *yaml.Node) (float64, bool)

NodeToFloat parses a YAML node to float.

func NodeToInt

func NodeToInt(node *yaml.Node) (int, bool)

NodeToInt parses a YAML node to int.

func NodeToInterface

func NodeToInterface(node *yaml.Node) (interface{}, bool)

NodeToInterface parses a YAML node into an interface{}.

func NodeToMap

func NodeToMap(node *yaml.Node) (map[string]interface{}, bool)

func NodeToScalarInterface

func NodeToScalarInterface(node *yaml.Node) (interface{}, bool)

func NodeToSlice

func NodeToSlice(node *yaml.Node) ([]interface{}, bool)

func NodeToString

func NodeToString(node *yaml.Node) (string, bool)

NodeToString parses a YAML node to string.

func ValueToNode

func ValueToNode(value interface{}) (*yaml.Node, error)

Types

type Interpreter

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

func NewInterpreter

func NewInterpreter(options ...InterpreterOption) (*Interpreter, error)

func (*Interpreter) CreateDecoder

func (ei *Interpreter) CreateDecoder(target interface{}) *interpretHelper

func (*Interpreter) CreateRawDecoder

func (ei *Interpreter) CreateRawDecoder(target *yaml.Node) *rawInterpretHelper

func (*Interpreter) LookupAll

func (ei *Interpreter) LookupAll(jsonPath string) (*yaml.Node, error)

func (*Interpreter) LookupFirst

func (ei *Interpreter) LookupFirst(jsonPath string) (*yaml.Node, error)

func (*Interpreter) Process

func (ei *Interpreter) Process(node *yaml.Node) (*yaml.Node, error)

func (*Interpreter) RegisterTag

func (ei *Interpreter) RegisterTag(tag string, f func(node *yaml.Node) (*yaml.Node, error)) error

type InterpreterOption

type InterpreterOption func(*Interpreter) error

func WithAdditionalTags

func WithAdditionalTags(tags map[string]func(node *yaml.Node) (*yaml.Node, error)) InterpreterOption

func WithFuncMap

func WithFuncMap(funcmap ...template.FuncMap) InterpreterOption

func WithVars

func WithVars(vars map[string]interface{}) InterpreterOption

Jump to

Keyboard shortcuts

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