Documentation ¶
Index ¶
- Variables
- func AddHost(address, keypath, username string) error
- func ImportHostsFromDeployment(deployment services.DeploymentConfigurationFile) error
- func ImportHostsFromRawDeployment(config []byte) error
- func ReadKeyFiles(keyFiles []string) ([]ssh.AuthMethod, error)
- func SetPassword(password string) []ssh.AuthMethod
- type CommandResult
- func ParalellDownload(hosts []HostSSHConfig, source, destination string, to int) []CommandResult
- func ParalellExecute(cmd, pipefile, pipecmd string, hosts []HostSSHConfig, to int) []CommandResult
- func ParalellUpload(hosts []HostSSHConfig, source, destination string, to int) []CommandResult
- func SingleExecute(cmd, pipefile, pipecmd string, host HostSSHConfig, to int) CommandResult
- type HostSSHConfig
- func (c HostSSHConfig) DownloadFile(source, destination string) error
- func (c *HostSSHConfig) ExecuteCmd(cmd string) (string, error)
- func (c *HostSSHConfig) ExecuteCmdWithStdinCmd(cmd, localCmd string) (string, error)
- func (c *HostSSHConfig) ExecuteCmdWithStdinFile(cmd, filePath string) (string, error)
- func (c *HostSSHConfig) StartConnection() (*ssh.Client, error)
- func (c *HostSSHConfig) StartSession() (*ssh.Session, error)
- func (c *HostSSHConfig) StopConnection() error
- func (c *HostSSHConfig) StopSession()
- func (c HostSSHConfig) String() string
- func (c HostSSHConfig) UploadFile(source, destination string) error
Constants ¶
This section is empty.
Variables ¶
var Hosts []HostSSHConfig
Hosts - The array of all hosts once loaded
Functions ¶
func ImportHostsFromDeployment ¶
func ImportHostsFromDeployment(deployment services.DeploymentConfigurationFile) error
ImportHostsFromDeployment - This will parse a deployment (either file or HTTP post)
func ImportHostsFromRawDeployment ¶
ImportHostsFromRawDeployment - This will parse a deployment (either file or HTTP post)
func ReadKeyFiles ¶
func ReadKeyFiles(keyFiles []string) ([]ssh.AuthMethod, error)
ReadKeyFiles - will read an array of keys from disk
func SetPassword ¶
func SetPassword(password string) []ssh.AuthMethod
SetPassword - Turn a password string into an SSH auth method
Types ¶
type CommandResult ¶
type CommandResult struct { Host string // Host that the command was being ran against Error error // Errors that may have been returned Result string // The CLI results }
CommandResult - This is returned when running commands against servers
func ParalellDownload ¶
func ParalellDownload(hosts []HostSSHConfig, source, destination string, to int) []CommandResult
ParalellDownload - Allow downloading a file over SFTP from multiple hosts in parallel
func ParalellExecute ¶
func ParalellExecute(cmd, pipefile, pipecmd string, hosts []HostSSHConfig, to int) []CommandResult
ParalellExecute - This will execute the same command in paralell across multiple hosts
func ParalellUpload ¶
func ParalellUpload(hosts []HostSSHConfig, source, destination string, to int) []CommandResult
ParalellUpload - Allow uploading a file over SFTP to multiple hosts in parallel
func SingleExecute ¶
func SingleExecute(cmd, pipefile, pipecmd string, host HostSSHConfig, to int) CommandResult
SingleExecute - This will execute a command on a single host
type HostSSHConfig ¶
type HostSSHConfig struct { Host string User string Timeout int ClientConfig *ssh.ClientConfig Session *ssh.Session Connection *ssh.Client }
HostSSHConfig - The struct of an SSH connection
func FindHosts ¶
func FindHosts(parlayHosts []string) ([]HostSSHConfig, error)
FindHosts - This will take an array of hosts and find the matching HostSSH Configuration
func (HostSSHConfig) DownloadFile ¶
func (c HostSSHConfig) DownloadFile(source, destination string) error
DownloadFile -
func (*HostSSHConfig) ExecuteCmd ¶
func (c *HostSSHConfig) ExecuteCmd(cmd string) (string, error)
ExecuteCmd -
func (*HostSSHConfig) ExecuteCmdWithStdinCmd ¶
func (c *HostSSHConfig) ExecuteCmdWithStdinCmd(cmd, localCmd string) (string, error)
ExecuteCmdWithStdinCmd -
func (*HostSSHConfig) ExecuteCmdWithStdinFile ¶
func (c *HostSSHConfig) ExecuteCmdWithStdinFile(cmd, filePath string) (string, error)
ExecuteCmdWithStdinFile -
func (*HostSSHConfig) StartConnection ¶
func (c *HostSSHConfig) StartConnection() (*ssh.Client, error)
StartConnection -
func (*HostSSHConfig) StartSession ¶
func (c *HostSSHConfig) StartSession() (*ssh.Session, error)
StartSession -
func (*HostSSHConfig) StopConnection ¶
func (c *HostSSHConfig) StopConnection() error
StopConnection -
func (HostSSHConfig) UploadFile ¶
func (c HostSSHConfig) UploadFile(source, destination string) error
UploadFile -