ssh

package
v0.0.0-...-ace9e8d Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShellExit = "shell_exit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient() *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) Execute

func (c *Client) Execute(cmd string) ([]byte, error)

func (*Client) NewSession

func (c *Client) NewSession() *Session

func (*Client) NewSftp

func (c *Client) NewSftp() *Sftp

func (*Client) Open

func (c *Client) Open(host string, port int, username string, password string) error

type OutputBuffer

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

func NewOutputBuffer

func NewOutputBuffer() *OutputBuffer

func (*OutputBuffer) Shift

func (s *OutputBuffer) Shift() []byte

func (*OutputBuffer) Write

func (s *OutputBuffer) Write(data []byte) (int, error)

type Scp

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

func NewScp

func NewScp(sshClient *ssh.Client) *Scp

func (*Scp) Disconnect

func (s *Scp) Disconnect() error

func (*Scp) Establish

func (s *Scp) Establish() error

func (*Scp) Pull

func (s *Scp) Pull(remoteDir, remoteFilename string, localDir, localFilename string, callbacks ...StatCallback) (int64, error)

func (*Scp) Push

func (s *Scp) Push(localDir, localFilename string, remoteDir, remoteFilename string, callbacks ...StatCallback) (int64, error)

func (*Scp) Remove

func (s *Scp) Remove(remoteDir, remoteFilename string) error

type Session

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

func NewSession

func NewSession(sshClient *ssh.Client) *Session

func (*Session) Disconnect

func (s *Session) Disconnect() error

func (*Session) Establish

func (s *Session) Establish() error

func (*Session) Execute

func (s *Session) Execute(cmd string) error

func (*Session) SetWriteCallback

func (s *Session) SetWriteCallback(writer io.Writer)

func (*Session) Watch

func (s *Session) Watch() error

type Sftp

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

func NewSftp

func NewSftp(sshClient *ssh.Client) *Sftp

func (*Sftp) Disconnect

func (s *Sftp) Disconnect() error

func (*Sftp) Establish

func (s *Sftp) Establish() error

func (*Sftp) Pull

func (s *Sftp) Pull(remoteDir, remoteFilename string, localDir, localFilename string, callbacks ...StatCallback) (int64, error)

func (*Sftp) Push

func (s *Sftp) Push(localDir, localFilename string, remoteDir, remoteFilename string, callbacks ...StatCallback) (int64, error)

func (*Sftp) Remove

func (s *Sftp) Remove(remoteDir, remoteFilename string) error

type StatCallback

type StatCallback = func(srcInfo os.FileInfo, srcErr error, dstInfo os.FileInfo, dstErr error)

Jump to

Keyboard shortcuts

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