shared

package
v0.0.0-...-7db67c4 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2015 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryExists

func DirectoryExists(directory string) string

DirectoryExists returns the condition to determine if the given directory exists in bash, e.g. -d directory

func ExtractBool

func ExtractBool(p interface{}) bool

ExtractBool converts the given interface to a boolean.

func ExtractOptions

func ExtractOptions(p interface{}) []string

ExtractOptions returns an array of strings from the given interface. This is useful if your options are defined as follows: plugin: foo options:

packages:
  - "foo"
  - "bar"
  - "baz"

func ExtractString

func ExtractString(p interface{}) string

ExtractString converts the given interface to a string.

Types

type Args

type Args struct {
	Environment []string
	Args        []string
	Options     map[string]interface{}
}

Args describes the args for the remote call.

type Command

type Command struct {
	Name string
	Args []string
}

Command describes the command and its args to run.

func NewCommand

func NewCommand(name string, args ...string) Command

NewCommand creates a new Command.

func (*Command) If

func (c *Command) If(condition string)

If wraps the current command in an if statement with the given condition.

func (*Command) Unless

func (c *Command) Unless(condition string)

Unless wraps the current command in an if not statement with the given condition.

type Responder

type Responder interface {
	Execute(args Args, reply *Response) error
}

Responder is the interface which defines a plugin.

type Response

type Response struct {
	Commands []Command
}

Response describes the response for the remote call.

func NewResponse

func NewResponse(commands ...Command) Response

NewResponse creates a new response with the given commands.

Jump to

Keyboard shortcuts

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