ssh

package
v0.0.0-...-deba36d Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomPassword

func GenerateRandomPassword(length int) (string, error)

func WaitForSSH

func WaitForSSH(host string, port int, username string, password string, privatekey []byte, timeout time.Duration) error

Types

type SSHConnection

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

func NewSSHConnection

func NewSSHConnection(host string, port int, username string, password string, privatekey []byte, timeout time.Duration) (*SSHConnection, error)

func (*SSHConnection) Close

func (s *SSHConnection) Close() error

func (*SSHConnection) ExecuteCommand

func (s *SSHConnection) ExecuteCommand(command string) (string, error)

func (*SSHConnection) ExecutePipeCommand

func (s *SSHConnection) ExecutePipeCommand(command string, pipesFunc func(reader io.Reader, errorReader io.Reader, writer io.Writer) error) error

func (*SSHConnection) Shell

func (s *SSHConnection) Shell(cmd string, stderr, stdout io.Writer, stdin io.Reader, width, height int) error

func (*SSHConnection) StartTunnel

func (s *SSHConnection) StartTunnel(localPort int, remotePort int, remoteHost string, reverse bool) (listeningPort int, err error)

func (*SSHConnection) WriteFile

func (s *SSHConnection) WriteFile(path string, mode os.FileMode, contentLength int64, content io.Reader, sudo bool, progress func(p float64)) error

Jump to

Keyboard shortcuts

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