sftp

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnConfig

type ConnConfig struct {
	Host       string
	Port       int
	User       string
	Pass       string
	PrivateKey string
	Passphrase string
}

type SFTP

type SFTP struct {
	Connected bool
	SSHClient *ssh2.Client
	Client    *sftp.Client
	Auth      ssh2.ClientConfig
	Config    ConnConfig
}

func New

func New(c ConnConfig) *SFTP

func (*SFTP) Connect

func (f *SFTP) Connect() error

func (*SFTP) Disconnect

func (f *SFTP) Disconnect() error

func (*SFTP) DownloadFile

func (f *SFTP) DownloadFile(remotePath string, localPath string) error

func (*SFTP) LimitByDate

func (f *SFTP) LimitByDate(remoteFolder string, beforeDurationPattern string) ([]string, error)

func (*SFTP) LimitByFileCount

func (f *SFTP) LimitByFileCount(remoteFolder string, limit int) ([]string, error)

func (*SFTP) LimitByLength

func (f *SFTP) LimitByLength(remoteFolder string, limitBytes int64) ([]string, error)

Jump to

Keyboard shortcuts

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