Documentation ¶
Index ¶
Constants ¶
View Source
const MaxNumberOfSSHConnections = 15
MaxNumberOfSSHConnections defines the max number of ssh connections to each ssh remote device that can be used to run commands concurrently.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct { // The name to use for this connection Name string // The hostname to connect to Host string `json:"host"` // User is the username to use for login User string `json:"user"` // Which port should be used Port uint16 `json:"port,string"` // The pem encoded public key file to use for the connection. // If not specified uses ~/.ssh/id_rsa Keyfile string `json:"keyPath"` // The known_hosts file to use for authentication. Defaults to // ~/.ssh/known_hosts KnownHosts string `json:"knownHostsPath"` // Environment variables to set on the connection Env []string }
Configuration represents a configuration for connecting to an SSH remote client. The SSH agent is first used to attempt connection, followed by the given Keyfile
func ReadConfigurations ¶
func ReadConfigurations(r io.Reader) ([]Configuration, error)
ReadConfigurations reads a set of configurations from then given reader, and returns the configurations to the user.
type Device ¶
type Device interface { bind.Device // PushFile will transfer the local file at sourcePath to the remote // machine at destPath PushFile(ctx context.Context, sourcePath, destPath string) error // PullFile will transfer the remote file at sourcePath to the local // machine at destPath PullFile(ctx context.Context, sourcePath, destPath string) error // MakeTempDir makes a temporary directory, and returns the // path, as well as a function to call to clean it up. MakeTempDir(ctx context.Context) (string, app.Cleanup, error) // WriteFile writes the given file into the given location on the remote device WriteFile(ctx context.Context, contents io.Reader, mode os.FileMode, destPath string) error // GetFilePermissions gets the unix permissions for the remote file GetFilePermissions(ctx context.Context, path string) (os.FileMode, error) // DefaultReplayCacheDir returns the default path for replay resource caches DefaultReplayCacheDir() string }
Device extends the bind.Device interface with capabilities specific to remote SSH clients
func GetConnectedDevice ¶
func GetConnectedDevice(ctx context.Context, c Configuration) (Device, error)
GetConnectedDevice returns a device that matches the given configuration.
Click to show internal directories.
Click to hide internal directories.