sftp

package
v0.0.0-...-35ec390 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Host        string `json:"host"`
	Key         string `json:"key"`
	UserName    string `json:"username"`
	Password    string `json:"password"`
	KeyPassword string `json:"keyPassword"`
	Port        int64  `json:"port"`
}

Endpoint is an instance of the SFTP Connection Details

type FileTransferConfirmation

type FileTransferConfirmation struct {
	LocalFileName    string
	LocalPath        string
	RemoteFileName   string
	RemotePath       string
	LocalSize        int64
	LocalHash        string
	RemoteSize       int64
	TransferredHash  string
	TransferredBytes int64
}

FileTransferConfirmation is a summmary of the transferred file

type Transport

type Transport interface {
	SendFile(string, string) (*FileTransferConfirmation, error)
	SendDir(string, string) (*list.List, *list.List)
	ListRemoteDir(remoteDir string) error
	GetFile(remoteFile string, localFile string) (*FileTransferConfirmation, error)
	GetDir(remoteDir string, localDir string) (*list.List, *list.List)
	CleanDir(string) error
	RemoveDir(string) error
	RemoveFile(string) error
	Close()
}

Transport is the accessible type for the sftp connection

func NewConnection

func NewConnection(name string, conf Endpoint, log *log.Entry) (Transport, error)

NewConnection establish a connection

Jump to

Keyboard shortcuts

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