syaml

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnterDocument

func EnterDocument(document *yaml.Node) (node *yaml.Node, err error)

Types

type Config

type Config struct {
	HandleAlias          bool
	AliasResolutionDepth int
}

func NewSyaml

func NewSyaml(handleAlias bool, aliasResolutionDepth int) (c Config)

func (*Config) AssertIsDocument

func (c *Config) AssertIsDocument(node *yaml.Node)

func (*Config) AssertIsInteger

func (c *Config) AssertIsInteger(node *yaml.Node)

func (*Config) AssertIsMapping

func (c *Config) AssertIsMapping(node *yaml.Node)

func (*Config) AssertIsScalar

func (c *Config) AssertIsScalar(node *yaml.Node)

func (*Config) AssertIsSequence

func (c *Config) AssertIsSequence(node *yaml.Node)

func (*Config) AssertIsString

func (c *Config) AssertIsString(node *yaml.Node)

func (*Config) ExtractContent

func (c *Config) ExtractContent(node *yaml.Node) interface{}

ExtractContent recurses through a tree of yaml.Node and produces a golang tree of map[string]interface{}, []interface{}, string and integer

func (*Config) GetInt

func (c *Config) GetInt(node *yaml.Node) int

Retrieve an integer value from a yaml.Node

func (*Config) GetString

func (c *Config) GetString(node *yaml.Node) string

Retrieve a string value from a yaml.Node

func (*Config) IsDocument

func (c *Config) IsDocument(node *yaml.Node) bool

func (*Config) IsInterger

func (c *Config) IsInterger(node *yaml.Node) bool

func (*Config) IsMapping

func (c *Config) IsMapping(node *yaml.Node) bool

func (*Config) IsMerge

func (c *Config) IsMerge(node *yaml.Node) bool

func (*Config) IsScalar

func (c *Config) IsScalar(node *yaml.Node) bool

func (*Config) IsSequence

func (c *Config) IsSequence(node *yaml.Node) bool

func (*Config) IsString

func (c *Config) IsString(node *yaml.Node) bool

func (*Config) MapAssertStringKeysAmong

func (c *Config) MapAssertStringKeysAmong(node *yaml.Node, acceptSlice []string)

MapAssertStringKeysAmong asserts the keys of the mapping node are all strings whose value is among the given slice of accepted values

func (*Config) MapGetAny

func (c *Config) MapGetAny(node *yaml.Node, key string) interface{}

Search through a yaml map for the entry associated to a given key and retrieve any kind of value, as interface{}

func (*Config) MapGetValue

func (c *Config) MapGetValue(node *yaml.Node, key string) *yaml.Node

Search through a yaml map for the value associated to a given key. Panic if the key is missing

func (*Config) MapTryGetValue

func (c *Config) MapTryGetValue(node *yaml.Node, key string) *yaml.Node

Search through a yaml map for the entry associated to a given key and return the value. Returns nil if the key is missing

func (*Config) Resolve

func (c *Config) Resolve(node **yaml.Node)

Jump to

Keyboard shortcuts

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