exec

package
v0.0.0-...-65247a5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2014 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecResponse

type ExecResponse struct {
	Code   int
	Stdout []byte
	Stderr []byte
}

ExecResponse contains the return code and output generated by executing a command.

func RunCommands

func RunCommands(run RunParams) (*ExecResponse, error)

RunCommands executes the Commands specified in the RunParams using '/bin/bash -s', passing the commands through as stdin, and collecting stdout and stderr. If a non-zero return code is returned, this is collected as the code for the response and this does not classify as an error.

type RunParams

type RunParams struct {
	Commands    string
	WorkingDir  string
	Environment []string
}

Parameters for RunCommands. Commands contains one or more commands to be executed using '/bin/bash -s'. If WorkingDir is set, this is passed through to bash. Similarly if the Environment is specified, this is used for executing the command.

Jump to

Keyboard shortcuts

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