ssh

package
v2.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 15 Imported by: 7

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 Endpoint

type Endpoint struct {
	Host string
	Port int
}

func (*Endpoint) String

func (endpoint *Endpoint) String() string

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)

type SSHtunnel

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

func NewSSHTunnel

func NewSSHTunnel(user, privateKey string, serverEndpoint *Endpoint, tunnels map[string]*SourceDestination, log *logging.Logger) (*SSHtunnel, error)

func (*SSHtunnel) Close

func (tunnel *SSHtunnel) Close()

func (*SSHtunnel) Start

func (tunnel *SSHtunnel) Start() error

func (*SSHtunnel) String

func (tunnel *SSHtunnel) String() string

type SourceDestination

type SourceDestination struct {
	Local  *Endpoint
	Remote *Endpoint
}

Jump to

Keyboard shortcuts

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