remote

package
v1.90.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCleanup added in v1.53.2

func WithCleanup() heartbeat.HandleOption

WithCleanup initializes and returns a heartbeat handle option, which deletes a local temporary file if downloaded from a remote file.

func WithDetection

func WithDetection() heartbeat.HandleOption

WithDetection initializes and returns a heartbeat handle option, which can be used in a heartbeat processing pipeline to detect remote file and download to a temporary directory.

Types

type Client

type Client struct {
	User         string
	Pass         string
	HostKeyAlias string
	OriginalHost string
	Host         string
	Port         int
	Path         string
}

Client communicates using sftp protocol.

func NewClient

func NewClient(address string) (Client, error)

NewClient initializes a new remote client.

func (Client) Connect

func (c Client) Connect() (*ssh.Client, *sftp.Client, error)

Connect connects to sftp host.

func (Client) DownloadFile

func (c Client) DownloadFile(localFile string) error

DownloadFile downloads a remote file and copy to a local file.

func (Client) DownloadFileFallback added in v1.81.0

func (c Client) DownloadFileFallback(localFile string) error

DownloadFileFallback downloads a remote file and copy to a local file using machine's ssh.

Jump to

Keyboard shortcuts

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