clissh

package
v6.51.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKeepAliveInterval = 30 * time.Second
)

Variables

This section is empty.

Functions

func DefaultListenerFactory

func DefaultListenerFactory() listenerFactory

func DefaultSecureDialer

func DefaultSecureDialer() secureDialer

func DefaultTerminalHelper

func DefaultTerminalHelper() terminalHelper

Types

type ListenerFactory

type ListenerFactory interface {
	Listen(network, address string) (net.Listener, error)
}

type LocalPortForward

type LocalPortForward struct {
	LocalAddress  string
	RemoteAddress string
}

type SecureClient

type SecureClient interface {
	NewSession() (SecureSession, error)
	Conn() ssh.Conn
	Dial(network, address string) (net.Conn, error)
	Wait() error
	Close() error
}

type SecureDialer

type SecureDialer interface {
	Dial(network, address string, config *ssh.ClientConfig) (SecureClient, error)
}

type SecureSession

type SecureSession interface {
	RequestPty(term string, height, width int, termModes ssh.TerminalModes) error
	SendRequest(name string, wantReply bool, payload []byte) (bool, error)
	StdinPipe() (io.WriteCloser, error)
	StdoutPipe() (io.Reader, error)
	StderrPipe() (io.Reader, error)
	Start(command string) error
	Shell() error
	Wait() error
	Close() error
}

type SecureShell

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

func NewDefaultSecureShell

func NewDefaultSecureShell() *SecureShell

func NewSecureShell

func NewSecureShell(
	secureDialer SecureDialer,
	terminalHelper TerminalHelper,
	listenerFactory ListenerFactory,
	keepAliveInterval time.Duration,
) *SecureShell

func (*SecureShell) Close

func (c *SecureShell) Close() error

func (*SecureShell) Connect

func (c *SecureShell) Connect(username string, passcode string, appSSHEndpoint string, appSSHHostKeyFingerprint string, skipHostValidation bool) error

func (*SecureShell) InteractiveSession

func (c *SecureShell) InteractiveSession(commands []string, terminalRequest TTYRequest) error

func (*SecureShell) LocalPortForward

func (c *SecureShell) LocalPortForward(localPortForwardSpecs []LocalPortForward) error

func (*SecureShell) Wait

func (c *SecureShell) Wait() error

type TTYRequest

type TTYRequest int
const (
	RequestTTYAuto TTYRequest = iota
	RequestTTYNo
	RequestTTYYes
	RequestTTYForce
)

type TerminalHelper

type TerminalHelper interface {
	GetFdInfo(in interface{}) (fd uintptr, isTerminal bool)
	SetRawTerminal(fd uintptr) (*term.State, error)
	RestoreTerminal(fd uintptr, state *term.State) error
	GetWinsize(fd uintptr) (*term.Winsize, error)
	StdStreams() (stdin io.ReadCloser, stdout io.Writer, stderr io.Writer)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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