mapping

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PluckKeys

func PluckKeys(input map[interface{}]interface{}) []interface{}

func PluckKeysStr

func PluckKeysStr(input map[string]string) []*string

Types

type Mapping

type Mapping map[interface{}]interface{}

func New

func New() Mapping

func NewFromYamlBytes

func NewFromYamlBytes(data []byte) (Mapping, error)

func NewFromYamlString

func NewFromYamlString(data string) (Mapping, error)

func (Mapping) GetChildMap

func (m Mapping) GetChildMap(key interface{}) (Mapping, error)

Attempts the get the Mapping under key. If it is not a mapping, an error is returned. If it does not exist, it is created and returned.

func (Mapping) PruneEmpty

func (m Mapping) PruneEmpty()

Removes all the empty values in the mapping, going in depth.

func (Mapping) ToYamlBytes

func (m Mapping) ToYamlBytes() ([]byte, error)

Marshals the mapping using yaml if mapping is nil, an empty byte array is returned.

Jump to

Keyboard shortcuts

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