ssh

package
v2.0.0-...-38803c9 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Client *ssh.Client

	Address *url.URL
	Log     *logging.Logger
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(address *url.URL, config *ssh.ClientConfig, log *logging.Logger) (*Connection, error)

func (*Connection) Close

func (sc *Connection) Close()

func (*Connection) Connect

func (sc *Connection) Connect() error

type ConnectionPool

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

func NewConnectionPool

func NewConnectionPool(log *logging.Logger) *ConnectionPool

func (*ConnectionPool) GetConnection

func (cp *ConnectionPool) GetConnection(address *url.URL, config *ssh.ClientConfig) (*Connection, error)

type SFTP

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

func NewSFTP

func NewSFTP(PrivateKey []string, Password, KnownHosts string, concurrency, maxClientConcurrency, maxPacketSize int, rsc *stream.ReadStreamQueue, log *logging.Logger) (*SFTP, error)

func (*SFTP) Get

func (s *SFTP) Get(uri *url.URL, w io.Writer) (int64, error)

func (*SFTP) GetConnection

func (s *SFTP) GetConnection(address *url.URL) (*Connection, error)

func (*SFTP) GetFile

func (s *SFTP) GetFile(uri *url.URL, user string, target string) (int64, error)

func (*SFTP) Put

func (s *SFTP) Put(uri *url.URL, r io.Reader) (int64, error)

func (*SFTP) PutFile

func (s *SFTP) PutFile(uri *url.URL, source string) (int64, error)

type SFTPConnection

type SFTPConnection struct {
	*Connection
	// contains filtered or unexported fields
}

func NewSFTPConnection

func NewSFTPConnection(sshConn *Connection, concurrency, maxClientConcurrency, maxPacketSize int) (*SFTPConnection, error)

func (*SFTPConnection) GetSFTPClient

func (sc *SFTPConnection) GetSFTPClient() (*sftp.Client, error)

func (*SFTPConnection) ReadFile

func (sc *SFTPConnection) ReadFile(path string, w io.Writer) (int64, error)

func (*SFTPConnection) WriteFile

func (sc *SFTPConnection) WriteFile(path string, r io.Reader) (int64, error)

Jump to

Keyboard shortcuts

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