playbook

package
v0.0.0-...-3500608 Latest Latest
Warning

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

Go to latest
Published: May 14, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte, m *Modules) error

Decode parses and loads the file that contains the module definitions

func Encode

func Encode(m Modules) ([]byte, error)

Encode returns the encode bytes of the module

func NewModules

func NewModules(scope scope.Scope, modules Modules, input io.Reader,
	options Options) (cli.Modules, error)

NewModules returns an implementation of Modules using a file at given URL. The file is in YAML format

Types

type Modules

type Modules map[Op]SourceURL

Modules is a mapping of operations and the source url that defines it

type Op

type Op string

Op is the name of the operation / sub-command

type Options

type Options struct {

	// ShowAllWarnings will print all warnings to the console.
	ShowAllWarnings bool

	template.Options `json:",inline" yaml:",inline"`
}

Options contains tuning params for the behavior of the templating engine and callables.

type Playbook

type Playbook struct {

	// Source is the original location
	Source string

	// Cache is the cached location, as a url of file:// format
	Cache string
}

Playbook contains information about the source and a local cache.

type Playbooks

type Playbooks map[Op]*Playbook

Playbooks is a collection of playbooks indexed by operation

func Load

func Load() (*Playbooks, error)

Load loads the playbook

func (*Playbooks) Add

func (pb *Playbooks) Add(op Op, source, cacheDir string)

Add adds an entry

func (Playbooks) Empty

func (pb Playbooks) Empty() bool

Empty returns true if there are no entries

func (*Playbooks) Has

func (pb *Playbooks) Has(op Op) bool

Has returns true if op is in the playbooks

func (*Playbooks) Modules

func (pb *Playbooks) Modules() map[Op]SourceURL

Modules returns the Modules

func (*Playbooks) Remove

func (pb *Playbooks) Remove(op Op)

Remove removes the entry

func (*Playbooks) Save

func (pb *Playbooks) Save() error

Save saves the playbooks

func (Playbooks) Source

func (pb Playbooks) Source(op Op) string

Source returns the source of the operation

func (*Playbooks) Visit

func (pb *Playbooks) Visit(f func(Op, Playbook))

Visit visits the entries

type SourceURL

type SourceURL string

SourceURL is the url of the module

Jump to

Keyboard shortcuts

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