qyaml

package
v0.0.0-...-5eee607 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveMapKey

func ResolveMapKey(m map[interface{}]interface{}, key string) interface{}

ResolveMapKey looks up key in m, trying it as a direct lookup, then by splitting on ">" and treating each element as a sub-key to look up.

func SplitHierarchyKey

func SplitHierarchyKey(key string) []string

SplitHierarchyKey splits a key on > into a key path.

Types

type YAML

type YAML struct {
	YAML interface{}
}

YAML represents a YAML document.

func MustParse

func MustParse(path string) YAML

MustParse parses the file at path into a YAML document, panicking on error.

func Parse

func Parse(path string) (YAML, error)

Parse parses the file at path into a YAML document.

func ParseBytes

func ParseBytes(text []byte) (YAML, error)

ParseBytes parses a []byte into a YAML document.

func Wrap

func Wrap(value interface{}) YAML

Wrap wraps value as a YAML document.

func (YAML) Key

func (y YAML) Key(key string) interface{}

Key gets the value with the given key, treating ">"-separated keys as nested objects to descend into.

func (YAML) Map

func (y YAML) Map(key string) map[interface{}]interface{}

Map gets the map object at key.

func (YAML) Slice

func (y YAML) Slice(key string) []interface{}

Slice gets the slice at key.

func (YAML) String

func (y YAML) String(key string) string

func (YAML) StringMap

func (y YAML) StringMap(key string) map[string]string

StringMap gets the map[string]string at key

func (YAML) StringSlice

func (y YAML) StringSlice(key string) []string

StringSlice gets the string slice at key

Jump to

Keyboard shortcuts

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