sftpclient

package
v0.1.0-beta10 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const StrictHostKeyCheckingNameParameter = "StrictHostKeyChecking"

Variables

This section is empty.

Functions

func KeyPrint

func KeyPrint(dialAddr string, addr net.Addr, key ssh.PublicKey) error

Types

type SsftpClient

type SsftpClient struct {
	// contains filtered or unexported fields
}

func NewSsftpClient

func NewSsftpClient(log *logrus.Logger, sshOpts SshOptions) (*SsftpClient, error)

func (*SsftpClient) DownloadFile

func (s *SsftpClient) DownloadFile(client *sftp.Client, remoteFile, localFile string) (err error)

Download file from sftp server

func (*SsftpClient) IsRemoteFileADir

func (s *SsftpClient) IsRemoteFileADir(client *sftp.Client, remoteFile string) (bool, error)

func (*SsftpClient) ListFiles

func (s *SsftpClient) ListFiles(client *sftp.Client, remoteDir string) (err error)

func (*SsftpClient) PublicKeyFile

func (s *SsftpClient) PublicKeyFile(file string) ssh.AuthMethod

func (*SsftpClient) RecursiveDownload

func (s *SsftpClient) RecursiveDownload(client *sftp.Client, remoteFile string, localFile string) (err error)

func (*SsftpClient) SetOption

func (s *SsftpClient) SetOption(param string) error

SetOption is waiting for parameter with this format option=value

func (*SsftpClient) SftpConnect

func (s *SsftpClient) SftpConnect(remote sftppath.Path, port string, sshkeyFile string) (*sftp.Client, error)

func (*SsftpClient) UploadFile

func (s *SsftpClient) UploadFile(client *sftp.Client, localFile, remoteFile string) (err error)

Upload file to sftp server

type SshOptions

type SshOptions []string

Structs to handle multiple SSHOptions arguments from the command line

func (*SshOptions) Set

func (i *SshOptions) Set(value string) error

func (*SshOptions) String

func (i *SshOptions) String() string

Jump to

Keyboard shortcuts

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