remote

package
v0.0.0-...-790482d Latest Latest
Warning

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

Go to latest
Published: May 31, 2016 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Masters map[string]chan struct{} = map[string]chan struct{}{}

A map of SSH masters

View Source
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.

func Start

func Start(cmd string, args []string, input *string, env *map[string]string, out *bytes.Buffer, err *bytes.Buffer) (*exec.Cmd, *bytes.Buffer, *bytes.Buffer, error)

Types

type JobSpec

type JobSpec struct {
	Cmd []string
	Env map[string]string
}

JobSpec is used to tell wrapper what to run

type Results

type Results struct {
	Out     string
	Err     string
	Success bool
	Status  int
}

Wrapper runs programs and captures the results in this structure.

Jump to

Keyboard shortcuts

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