Documentation
¶
Index ¶
- Constants
- func DefaultListenerFactory() listenerFactory
- func DefaultSecureDialer() secureDialer
- func DefaultTerminalHelper() terminalHelper
- type ListenerFactory
- type LocalPortForward
- type SecureClient
- type SecureDialer
- type SecureSession
- type SecureShell
- func (c *SecureShell) Close() error
- func (c *SecureShell) Connect(username string, passcode string, appSSHEndpoint string, ...) error
- func (c *SecureShell) InteractiveSession(commands []string, terminalRequest TTYRequest) error
- func (c *SecureShell) LocalPortForward(localPortForwardSpecs []LocalPortForward) error
- func (c *SecureShell) Wait() error
- type TTYRequest
- type TerminalHelper
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) 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
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)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.