Documentation ¶
Index ¶
- type Connection
- func (c *Connection) CopyRemote(hostname, path string) error
- func (c *Connection) Execute(cmd string) ([]byte, error)
- func (c *Connection) ExecuteWithRetries(cmd string, sleep, duration time.Duration) ([]byte, error)
- func (c *Connection) Read(path string) ([]byte, error)
- func (c *Connection) Write(data, path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { Host string Port string User string PrivateKeyPath string ClientConfig *ssh.ClientConfig Client *ssh.Client }
Connection is
func NewConnection ¶
func NewConnection(host, port, user, keyPath string) (*Connection, error)
NewConnection will build and return a new Connection object
func (*Connection) CopyRemote ¶ added in v0.13.0
func (c *Connection) CopyRemote(hostname, path string) error
CopyRemote uses this ssh connection to scp remote files
func (*Connection) Execute ¶
func (c *Connection) Execute(cmd string) ([]byte, error)
Execute will execute a given cmd on a remote host
func (*Connection) ExecuteWithRetries ¶
ExecuteWithRetries will keep retrying a command until it does not return an error or the duration is exceeded
func (*Connection) Write ¶
func (c *Connection) Write(data, path string) error
Click to show internal directories.
Click to hide internal directories.