parser

package
v5.6.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoLocation is thrown when no location is provided for the Playbook file
	ErrNoLocation = fmt.Errorf("playbook location was not provided")
	// ErrReadFile is thrown when the Playbook file cannot be read/accessed
	ErrReadFile = fmt.Errorf("could not read playbook file")
	// ErrTextTplParsing is thrown when the templates in the Playbook file cannot be parsed.
	//
	// E.g. {{ Env "Hostname" }}
	ErrTextTplParsing = fmt.Errorf("failed to parse the playbook file")
	// ErrFileUnmarshall is thrown when the content of the Playbook file cannot be successfully unmarshalled into a domain.Playbook object
	ErrFileUnmarshall = fmt.Errorf("failed to unmarshal the playbook file")
)

Functions

func ReadPlaybook

func ReadPlaybook(location string) (domain.Playbook, error)

ReadPlaybook reads the file in location, parses the content and returns a Playbook object

func ReadPlaybookRaw

func ReadPlaybookRaw(location string) (map[string]interface{}, error)

ReadPlaybookRaw reads the file in location and parses the content to a map.

This is specially useful to avoid parsing the template values in the file

func WritePlaybook

func WritePlaybook(object interface{}, location string) error

WritePlaybook takes an object and serializes it to a file in the given location

Types

This section is empty.

Jump to

Keyboard shortcuts

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