Documentation ¶
Index ¶
- Variables
- func CopyToRemote(ip string, user string, keypath string, src string, dest string) (*string, *string, bool, int)
- func Exec(cmd string, args []string, input *string, env *map[string]string) (*string, *string, bool, int)
- func RemoteMithras(inst *ec2.Instance, user string, keypath string, js string, become bool, ...) (*string, *string, bool, int)
- func RemoteShell(ip string, user string, keypath string, input *string, cmd string, ...) (*string, *string, bool, int)
- func RemoteWrapper(inst *ec2.Instance, user string, keypath string, cmd []string, ...) (*string, *string, bool, int)
- func Start(cmd string, args []string, input *string, env *map[string]string, ...) (*exec.Cmd, *bytes.Buffer, *bytes.Buffer, error)
- type JobSpec
- type Results
Constants ¶
This section is empty.
Variables ¶
var Masters map[string]chan struct{} = map[string]chan struct{}{}
A map of SSH masters
var Mutex = &sync.Mutex{}
Functions ¶
func CopyToRemote ¶
func CopyToRemote(ip string, user string, keypath string, src string, dest string) (*string, *string, bool, int)
This function copies a file from the local machine to a remote host, and captures the output in a sturctured format.
func Exec ¶
func Exec(cmd string, args []string, input *string, env *map[string]string) (*string, *string, bool, int)
Exec gives the caller a way to run a program locally by forking and exec'ing it.
func RemoteMithras ¶
func RemoteMithras(inst *ec2.Instance, user string, keypath string, js string, become bool, becomeUser string, becomeMethod string, verbose bool) (*string, *string, bool, int)
Run mithras on a remote system, perhaps with escalated privileges, using the supplied javascript as the file mithras will read in and call the `run()` function on.
func RemoteShell ¶
func RemoteShell(ip string, user string, keypath string, input *string, cmd string, env *map[string]string, useControl bool) (*string, *string, bool, int)
`RemoteShell` provides the facility to execute command in a shell on a remote system. The caller provides an ip address (or hostname) in string form, the appropriate remote user and a path to the SSH key, a shell command and an environment.
`RemoteShell` runs the local `ssh` command under `ssh-agent`.
func RemoteWrapper ¶
func RemoteWrapper(inst *ec2.Instance, user string, keypath string, cmd []string, env *map[string]string, verbose bool) (*string, *string, bool, int)
Callers use `RemoteWrapper` to run a single program on a remote system, supplying a set of args and an environment, capturing the results in a consistent way.