command

package
v0.0.0-...-303912c Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const COMMAND_TYPE_CONTAINERIZED = "container"
View Source
const COMMAND_TYPE_EXEC = "exec"
View Source
const COMMAND_TYPE_SET = "set"
View Source
const COMMAND_TYPE_UNKNOWN_TYPE = "unknown"
View Source
const (
	WUNDERTOOLS_COMMAND_YAML_FILE = "commands.yml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Prepare(name string, allCommands *Commands)
	Init(app *config.Application)
	Settings(settings interface{})
	Exec(flags ...string)
}

func IsThisACommand

func IsThisACommand(application *config.Application, name string) (Command, bool)

Determine if the string corresponds to a command name, and if so return a command object for it.

type CommandBase

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

func (*CommandBase) Init

func (command *CommandBase) Init(application *config.Application)

func (*CommandBase) Prepare

func (command *CommandBase) Prepare(name string, allCommands *Commands)

type CommandFromYaml

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

func (*CommandFromYaml) UnmarshalYAML

func (command *CommandFromYaml) UnmarshalYAML(unmarshal func(interface{}) error) error

type CommandSet

type CommandSet struct {
	CommandBase
	// contains filtered or unexported fields
}

func (*CommandSet) Exec

func (command *CommandSet) Exec(flags ...string)

func (*CommandSet) Init

func (command *CommandSet) Init(application *config.Application)

func (*CommandSet) Settings

func (command *CommandSet) Settings(settings interface{})

type CommandSetSettings

type CommandSetSettings struct {
	Commands []string `yaml:"commands"`
}

type Commands

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

a map of CommandDefinitions

func (*Commands) Add

func (commands *Commands) Add(name string, command Command)

add a new command to the list

func (*Commands) Commands_FromYaml

func (commands *Commands) Commands_FromYaml(application *config.Application)

iterate through all of the conf paths, and load commands.yml

func (*Commands) Get

func (commands *Commands) Get(name string) (Command, bool)

func (*Commands) List

func (commands *Commands) List() []string

list command names

type CommandsFromYaml

type CommandsFromYaml map[string]CommandFromYaml

type ContainerizedCommand

type ContainerizedCommand struct {
	CommandBase
	// contains filtered or unexported fields
}

func (*ContainerizedCommand) Exec

func (command *ContainerizedCommand) Exec(flags ...string)

func (*ContainerizedCommand) Init

func (command *ContainerizedCommand) Init(application *config.Application)

func (*ContainerizedCommand) Settings

func (command *ContainerizedCommand) Settings(settings interface{})

type ContainerizedCommandSettings

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

func (*ContainerizedCommandSettings) UnmarshalYAML

func (settings *ContainerizedCommandSettings) UnmarshalYAML(unmarshal func(interface{}) error) error

type ExecCommand

type ExecCommand struct {
	CommandBase
	// contains filtered or unexported fields
}

func (*ExecCommand) Exec

func (command *ExecCommand) Exec(flags ...string)

func (*ExecCommand) Init

func (command *ExecCommand) Init(application *config.Application)

func (*ExecCommand) Settings

func (command *ExecCommand) Settings(settings interface{})

type ExecCommandSettings

type ExecCommandSettings struct {
	EnvironmentVars map[string]string `yaml:"vars"`
	Exec            []string          `yaml:"exec"`
	RunDir          string            `yaml:"path"`
}

type UnknownTypeCommand

type UnknownTypeCommand struct {
	CommandBase
	// contains filtered or unexported fields
}

func (*UnknownTypeCommand) Exec

func (command *UnknownTypeCommand) Exec(flags ...string)

func (*UnknownTypeCommand) Init

func (command *UnknownTypeCommand) Init(application *config.Application)

func (*UnknownTypeCommand) Settings

func (command *UnknownTypeCommand) Settings(settings interface{})

type UnknownTypeCommandSettings

type UnknownTypeCommandSettings struct {
	Type string `yaml:"type"`
}

Jump to

Keyboard shortcuts

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