ssh

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNetwork = "tcp"
	DefaultPort    = "22"
	DefaultTimeout = uint32(1)
)

SSH constants.

Variables

This section is empty.

Functions

func NewSSHClient

func NewSSHClient(ip, user, privateKeyFile string) (*ssh.Client, error)

NewSSHClient creates and returns a ssh client with an active connection. The consumer of the client must ensure that the connection is closed.

func RunSSHCommand

func RunSSHCommand(ip, user, privateKeyFile, command string) ([]byte, []byte, error)

RunSSHCommand runs command using a given sh client and returns the output and error from the command execution.

func StartSSHCommand

func StartSSHCommand(ip, user, privateKeyFile, command string) error

StartSSHCommand runs command and doesn't wait for the command to complete.

Types

This section is empty.

Jump to

Keyboard shortcuts

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