sftputils

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package sftputils can be used in order to copy file from SSH too. You just need to set SSH port instead of SFTP

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) Close added in v0.0.68

func (c *SFTPClient) Close() error

func (*SFTPClient) CreateDirectory

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

func (*SFTPClient) DeleteDirectory

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

func (*SFTPClient) DeleteFile added in v0.0.51

func (c *SFTPClient) DeleteFile(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) List added in v0.0.71

func (c *SFTPClient) List(path string) ([]string, error)

func (*SFTPClient) Put

func (c *SFTPClient) Put(data []byte, fpath 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)

NewConn 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