sshutil

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = fmt.Errorf("timeout")

Functions

func DownloadPathWith

func DownloadPathWith(ftp *sftp.Client, remotePath string, localPath string) error

func UploadPathWith

func UploadPathWith(ftp *sftp.Client, localPath string, remotePath string) error

Types

type Config

type Config struct {
	Remote Remote
	Proxy  *Remote

	SSHKey     string
	SSHKeyPath string
	SSHTimeout time.Duration
	// contains filtered or unexported fields
}

func (*Config) DownloadPath

func (c *Config) DownloadPath(remotePath string, localPath string) error

func (*Config) NewSftp

func (c *Config) NewSftp() (*sftp.Client, func() error, error)

func (*Config) Run

func (c *Config) Run(cmd string, timeout ...time.Duration) (string, string, error)

func (*Config) StreamLog

func (c *Config) StreamLog(ctx context.Context, cmd string, logName string, log func(msg string, args ...any), timeout ...time.Duration) error

func (*Config) UploadPath

func (c *Config) UploadPath(localPath string, remotePath string) error

func (*Config) Wait

func (c *Config) Wait(ctx context.Context) error

type Remote

type Remote struct {
	User string
	Host string
	Port uint
}

Jump to

Keyboard shortcuts

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