ssh

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFromRemote

func CopyFromRemote(host *RemoteHost, remoteFile *RemoteFile, destinationPath string) (stderr string, err error)

CopyFromRemote copies a remote file to the local host

func CopyToRemote

func CopyToRemote(host *RemoteHost, file *RemoteFile) (combinedOutput string, err error)

CopyToRemote copies a file to a remote host

func ExecuteRemote

func ExecuteRemote(host *RemoteHost, script string) (combinedOutput string, err error)

ExecuteRemote executes a script in a remote host

func PublicKeyAuth

func PublicKeyAuth(sshPrivateKeyPath string) (ssh.AuthMethod, error)

PublicKeyAuth returns an AuthMethod that uses a ssh key pair

Types

type AuthConfig

type AuthConfig struct {
	User           string
	Password       string
	PrivateKeyPath string
}

type JumpBox

type JumpBox struct {
	URI             string
	Port            int
	OperatingSystem api.OSType
	AuthConfig      *AuthConfig
}

type RemoteFile

type RemoteFile struct {
	Path        string
	Permissions string
	Owner       string
	Content     []byte
}

type RemoteHost

type RemoteHost struct {
	URI             string
	Port            int
	OperatingSystem api.OSType
	AuthConfig      *AuthConfig
	Jumpbox         *JumpBox
}

Jump to

Keyboard shortcuts

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