remote

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSHClient

type SSHClient struct {
	SSH  *ssh.Client
	SFTP *sftp.Client
}

func NewSSHClient

func NewSSHClient(kp *keypairs.KeyPair, ip string) (*SSHClient, error)

NewSSHClient creates a new ssh connection to a remote server. It will attempt to connect up to 10 times with a 10-second gap to prevent a crash should the first attempt fail while the server is booting.

func (*SSHClient) CopyFromRemoteServer

func (s *SSHClient) CopyFromRemoteServer(srcPath, dstPath, filename string) (*os.File, error)

CopyFromRemoteServer uses sftp to copy a file from a remotes server to a local directory.

func (*SSHClient) SFTPClose

func (s *SSHClient) SFTPClose() error

SFTPClose just runs client.SFTPClose()

func (*SSHClient) SSHClose

func (s *SSHClient) SSHClose() error

SSHClose just runs client.SSHClose()

Jump to

Keyboard shortcuts

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