remote

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: GPL-3.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 Remote

type Remote struct {
	Hostname string
	Port     int
	Username string
	Password string
	Logger   *log.Logger
	// contains filtered or unexported fields
}

Remote represents a SSH/SFTP client for remote server operations

func New

func New(h host.Host, logger *log.Logger) (*Remote, error)

New creates a new Remote instance and establishes connections

func (*Remote) Close

func (r *Remote) Close() error

Close closes all connections

func (*Remote) DownloadDirectory

func (r *Remote) DownloadDirectory(remoteDir, localDir string) error

DownloadDirectory downloads a remote directory recursively to local path

func (*Remote) DownloadFile

func (r *Remote) DownloadFile(remotePath, localPath string) error

DownloadFile downloads a remote file to local path

func (*Remote) ExecuteCommand

func (r *Remote) ExecuteCommand(cmd string) (int, string, string, error)

ExecuteCommand executes a command on remote host and returns the output

func (*Remote) UploadDirectory

func (r *Remote) UploadDirectory(localDir, remoteDir string) error

UploadDirectory uploads a local directory recursively to remote path

func (*Remote) UploadFile

func (r *Remote) UploadFile(localPath, remotePath string) error

UploadFile uploads a local file to remote path

Jump to

Keyboard shortcuts

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