summon

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFs

func GetFs() afero.Fs

GetFs returns the current filesystem

Types

type Interface

type Interface interface {
	Configure(opts ...Option) error
	Summon(opts ...Option) (string, error)
	List(opts ...Option) ([]string, error)
	Run(opts ...Option) error
}

Interface for summon

type Option

type Option func(*options) error

Option allows specifying configuration settings from the user

func All

func All(all bool) Option

All specifies to download all config files

func Args

func Args(args ...string) Option

Args captures the arguments to be passed to run

func Dest

func Dest(dest string) Option

Dest specifies where the file(s) will be rooted

func Filename

func Filename(filename string) Option

Filename sets the reuqested filename in the boxed data

func JSON

func JSON(j string) Option

JSON configures the dictionary to use to render a templated asset

func Raw added in v0.4.0

func Raw(raw bool) Option

func Ref

func Ref(ref string) Option

Ref references an exec config entry

func ShowTree

func ShowTree(tree bool) Option

ShowTree will print a pretty graph of the data tree

type Summoner

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

Summoner manages functionality of summon

func New

func New(box *packr.Box, opts ...Option) (*Summoner, error)

New creates the summoner

func (*Summoner) Configure

func (b *Summoner) Configure(opts ...Option) error

Configure is used to extract options to the object.

func (*Summoner) List

func (s *Summoner) List(opts ...Option) ([]string, error)

List list the content of the data tree.

func (*Summoner) Run

func (s *Summoner) Run(opts ...Option) error

Run will run go or executable scripts in the context of the data

func (*Summoner) Summon

func (s *Summoner) Summon(opts ...Option) (string, error)

Summon is the main comnand invocation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳