yaml

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncryptedTag = "!encrypted"
	DecryptedTag = "!secret"
)

Variables

This section is empty.

Functions

func DecryptNode added in v0.3.0

func DecryptNode(node *yaml.Node, cache *cache.Cache, tag bool) error

Turn a yaml Node tagged !encrypted into a yaml Node tagged !secret, by looking up its values in a give mapping of ciphertexts to plaintexts.

func EncryptNode added in v0.3.0

func EncryptNode(node *yaml.Node, possibleCiphertext []byte, cache *cache.Cache) error

Turn a yaml Node tagged !secret into a yaml Node tagged !encrypted, looking up its values in a given mapping of plaintexts to ciphertexts.

func GetTaggedChildren added in v0.3.0

func GetTaggedChildren(node *yaml.Node, tag string) <-chan *nodeNode

A Channel-based iterator that yields all descendents of a yaml Node that match a given tag.

func GetTaggedChildrenValues added in v0.3.0

func GetTaggedChildrenValues(node *yaml.Node, tag string) (out map[string]string, err error)

Get a map of paths to decoded string values from all descendents of a yaml Node that match a given tag.

func GetValue added in v0.3.0

func GetValue(node *yaml.Node) (value string, err error)

Get the decoded value of an !encrypted or !secret Node, as a String. !encrypted Nodes are base64-decoded.

func ReadFile added in v0.3.0

func ReadFile(path string) (node yaml.Node, err error)

Read a yaml file, and return its root yaml Node.

func SaveFile

func SaveFile(path string, node yaml.Node) error

Save a yaml Node to a file.

Types

type Path

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

func (*Path) AddInt

func (p *Path) AddInt(val int) *Path

func (*Path) AddString

func (p *Path) AddString(val string) *Path

func (*Path) String

func (p *Path) String() string

Jump to

Keyboard shortcuts

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