ftp

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_KEY_EXCHANGE_ALGO = []string{"diffie-hellman-group-exchange-sha256"}

Functions

This section is empty.

Types

type SFTPClient

type SFTPClient struct {
	Client *sftp.Client
}

func (*SFTPClient) CreateDirectory

func (c *SFTPClient) CreateDirectory(path string) error

func (*SFTPClient) DeleteDirectory

func (c *SFTPClient) DeleteDirectory(path string) error

func (*SFTPClient) Exist

func (c *SFTPClient) Exist(path string) (bool, error)

func (*SFTPClient) Get

func (c *SFTPClient) Get(remoteFile string) (*bytes.Buffer, error)

func (*SFTPClient) IsDir

func (c *SFTPClient) IsDir(path string) (bool, error)

func (*SFTPClient) IsFile

func (c *SFTPClient) IsFile(path string) (bool, error)

func (*SFTPClient) Put

func (c *SFTPClient) Put(data []byte, path string) error

type SFTPConf

type SFTPConf struct {
	Host     string `json:"host"`
	User     string `json:"user"`
	Password string `json:"pass"`
	Port     int    `json:"port"`
	Timeout  int    `json:"timeout"`
}

func (*SFTPConf) NewConn

func (c *SFTPConf) NewConn(keyExchanges []string) (*SFTPClient, error)

Create a new SFTP connection by given parameters

Jump to

Keyboard shortcuts

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