yaml

package
v1.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package yaml provides helper functions for working with yaml

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

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

Marshal wraps the ghodss/yaml.Marshal

func ReadYAML

func ReadYAML(filepath string) (obj map[string]interface{}, err error)

ReadYAML reads the target file and returns a map[string]interface{} data structure representing the yaml read in.

func Unmarshal

func Unmarshal(y []byte, o interface{}) error

Unmarshal wraps the ghodss/yaml.Unmarshal

func WriteYAML

func WriteYAML(filepath string, obj interface{}, perms ...uint32) (err error)

WriteYAML converts the given obj interface{} into yaml then writes to disk with default permissions. Expects obj to be a structure that github.com/ghodss/yaml understands

Types

This section is empty.

Jump to

Keyboard shortcuts

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