yaml

package
v1.0.0-alpha.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(value interface{}) ([]byte, error)

func Unmarshal

func Unmarshal(in []byte, out interface{}) error

func UnmarshalMap

func UnmarshalMap(unmarshal func(interface{}) error) (map[string]interface{}, error)

UnmarshalMap allows unmarshaling into types that are safe to then be marshaled to json. By default yaml serializer converts these to map[interface{}]interface which cannot be serialised as json see https://github.com/go-yaml/yaml/issues/139 This is still required even with v3 because if any key isn't parsed as a string, e.g. you have a key named 1 or 2, then the bug is still triggered.

Types

type Editor added in v1.0.1

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

Editor can modify the yaml in a Porter manifest.

func NewEditor added in v1.0.1

func NewEditor(cxt *context.Context) *Editor

func (*Editor) Read added in v1.0.1

func (e *Editor) Read(data []byte) (n int, err error)

func (*Editor) ReadFile added in v1.0.1

func (e *Editor) ReadFile(src string) error

func (*Editor) SetValue added in v1.0.1

func (e *Editor) SetValue(path string, value string) error

func (*Editor) WriteFile added in v1.0.1

func (e *Editor) WriteFile(dest string) error

Jump to

Keyboard shortcuts

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