Documentation ¶
Index ¶
- Constants
- func CopyTo(c Command) bool
- func CopyToWithOutput(c Command) ([]byte, error)
- func Run(c []Command, i resource.Instance) bool
- func RunAsRoot(c []Command, i resource.Instance) bool
- func RunLocal(c Command) bool
- func RunLocalWithOutput(c Command) ([]byte, error)
- func RunQuiet(c []Command, i resource.Instance) bool
- func RunQuietAsRoot(c []Command, i resource.Instance) bool
- func RunRemote(c Command) bool
- func RunRemoteWithOutput(c Command) ([]byte, error)
- func RunSudo(c Command) bool
- func RunSudoWithOutput(c Command) ([]byte, error)
- func RunWithOutput(c []Command, i resource.Instance) ([]byte, error)
- func RunWithOutputAsRoot(c []Command, i resource.Instance) ([]byte, error)
- type Command
Constants ¶
const ( // Run a script on the local machine. Local = iota // Remote is a command that combines a copy and a sudo command. Remote // Copy a file from the local machine to the target instance. Copy // Run a script on the target machine as with super user priviledges. Sudo // Output a message to the console Message )
Variables ¶
This section is empty.
Functions ¶
func CopyTo ¶
CopyTo copies the give source script to the destination on the given instance. It returns true on success. Command output is send as messages to the console.
func CopyToWithOutput ¶
CopyToWithOutput copies the give source script to the destination on the given instance. The command output and an error are returned.
func Run ¶
Run runs a set of commands. Remote and copy commands are directed to the given instance. If the instance is nil, the set of commands should all be local. It returns true on success. Command output is send as messages to the console.
func RunAsRoot ¶
RunAsRoot runs a set of commands as root. Remote and copy commands are directed to the given instance. If the instance is nil, the set of commands should all be local. It returns true on success. Command output is send as messages to the console.
func RunLocal ¶
RunLocal runs the given command as a local command. It returns true on success. Command output is send as messages to the console.
func RunLocalWithOutput ¶
RunLocalWithOutput runs the given command as a local command. The command output and an error are returned.
func RunQuiet ¶
RunQuiet runs a set of commands the same as Run, however messaging to the console is disabled for the run.
func RunQuietAsRoot ¶
RunQuietAsRoot runs a set of commands the same as RunAsRoot, however messaging to the console is disabled for the run.
func RunRemote ¶
RunRemote copies the source script from the given command to the destination on the instance. It then runs the script on the instance. It returns true on success. Command output is send as messages to the console.
func RunRemoteWithOutput ¶
RunRemoteWithOutput copies the source script from the given command to the destination on the instance. It then runs the script on the instance. The command output and an error are returned.
func RunSudo ¶
RunSudo runs the given command on the instance under sudo. It returns true on success. Command output is send as messages to the console.
func RunSudoWithOutput ¶
RunSudoWithOutput runs the given command on the instance under sudo. The command output and an error are returned.
func RunWithOutput ¶
RunWithOutput runs a set of commands. Remote and copy commands are directed to the given instance. If the instance is nil, the set of commands should all be local. The command output and an error are returned.
func RunWithOutputAsRoot ¶
RunWithOutputAsRoot runs a set of commands as root. Remote and copy commands are directed to the given instance. If the instance is nil, the set of commands should all be local. The command output and an error are returned.
Types ¶
type Command ¶
type Command struct { // Type is required in a command set and not needed it an individual run command. // These are Local, Remote, Copy and Sudo. Type cType // Instance is required in an individual run command and not needed in a command set. Instance resource.Instance // The description of the command. This will be send as a message to the console. Desc string // The source of the command. For local and sudo type of commands, this is the // path to the command to be executed. For copy and remote commands this is the // path of the script to copy to the target instance. Src string // The destination of the command. This is unneeded for local and sudo commands. // For remote and copy commands, this is the location on the target instance // where the script will be copied to Dest string // The arguments passed to the command. This is unneeded for the copy command Args []string // contains filtered or unexported fields }
The Command structure.