Documentation ¶
Index ¶
- type DockerShell
- func (d *DockerShell) ChangeWindowSize(win hosts.ShellWindowSize) error
- func (d *DockerShell) Close() error
- func (d *DockerShell) ExecStart(needRestore bool) error
- func (d *DockerShell) MonitorTtySize(ctx context.Context) error
- func (d *DockerShell) OpenTerminal(_ hosts.ShellWindowSize) error
- func (d *DockerShell) ResizeTty(ctx context.Context) error
- func (d *DockerShell) ResizeTtyTo(ctx context.Context, height, width uint) error
- func (d *DockerShell) SetIO(stdout, stderr io.Writer, stdin io.ReadCloser)
- func (d *DockerShell) SetStdio(stdout, stderr io.Writer, stdin io.ReadCloser) *DockerShell
- func (d *DockerShell) SetWriter(w io.Writer) *DockerShell
- func (d *DockerShell) Terminal() error
- func (d *DockerShell) Wait() error
- func (d *DockerShell) Write(_ []byte) error
- type PtyShell
- func (d *PtyShell) ChangeWindowSize(win hosts.ShellWindowSize) error
- func (d *PtyShell) Close() error
- func (d *PtyShell) OpenTerminal(win hosts.ShellWindowSize) error
- func (d *PtyShell) SetIO(stdout, stderr io.Writer, stdin io.ReadCloser)
- func (d *PtyShell) Terminal() error
- func (d *PtyShell) Wait() error
- func (d *PtyShell) Write(b []byte) error
- type SSHDialer
- type SSHShell
- func (d *SSHShell) ChangeWindowSize(win hosts.ShellWindowSize) error
- func (d *SSHShell) Close() error
- func (d *SSHShell) OpenTerminal(win hosts.ShellWindowSize) error
- func (d *SSHShell) SetIO(stdout, stderr io.Writer, stdin io.ReadCloser)
- func (d *SSHShell) SetWriter(w io.Writer) *SSHShell
- func (d *SSHShell) Terminal() error
- func (d *SSHShell) Wait() error
- func (d *SSHShell) Write(_ []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerShell ¶
type DockerShell struct { Stdin io.ReadCloser Stdout io.Writer Stderr io.Writer Writer io.Writer // contains filtered or unexported fields }
DockerShell struct for docker dialer.
func NewDockerShell ¶
func NewDockerShell(n *types.Node) (*DockerShell, error)
NewDockerDialer returns new docker dialer.
func (*DockerShell) ChangeWindowSize ¶
func (d *DockerShell) ChangeWindowSize(win hosts.ShellWindowSize) error
ChangeWindowSize change tty window size for websocket.
func (*DockerShell) ExecStart ¶
func (d *DockerShell) ExecStart(needRestore bool) error
ExecStart handles setting up the IO and then begins streaming stdin/stdout to/from the hijacked connection, blocking until it is either done reading output, the user inputs the detach key sequence when in TTY mode, or when the given context is cancelled. Borrowed from https://github.com/docker/cli/blob/master/cli/command/container/hijack.go#L40.
func (*DockerShell) MonitorTtySize ¶
func (d *DockerShell) MonitorTtySize(ctx context.Context) error
MonitorTtySize monitor and change tty size. Borrowed from https://github.com/docker/cli/blob/master/cli/command/container/tty.go#L71.
func (*DockerShell) OpenTerminal ¶
func (d *DockerShell) OpenTerminal(_ hosts.ShellWindowSize) error
OpenTerminal open docker websocket terminal.
func (*DockerShell) ResizeTty ¶
func (d *DockerShell) ResizeTty(ctx context.Context) error
ResizeTty changes to the current win size.
func (*DockerShell) ResizeTtyTo ¶
func (d *DockerShell) ResizeTtyTo(ctx context.Context, height, width uint) error
ResizeTtyTo changes the size of the tty for an exec process running inside a container.
func (*DockerShell) SetIO ¶
func (d *DockerShell) SetIO(stdout, stderr io.Writer, stdin io.ReadCloser)
SetIO set dialer's reader and writer.
func (*DockerShell) SetStdio ¶
func (d *DockerShell) SetStdio(stdout, stderr io.Writer, stdin io.ReadCloser) *DockerShell
SetStdio set dialer's reader and writer.
func (*DockerShell) SetWriter ¶
func (d *DockerShell) SetWriter(w io.Writer) *DockerShell
SetWriter set dialer's logs writer.
func (*DockerShell) Terminal ¶
func (d *DockerShell) Terminal() error
Terminal open docker exec terminal.
func (*DockerShell) Wait ¶
func (d *DockerShell) Wait() error
Wait waits for the command to exit. Borrowed from https://github.com/docker/cli/blob/master/cli/command/container/exec.go#L180.
type PtyShell ¶
type PtyShell struct { Stdin io.ReadCloser Stdout io.Writer Stderr io.Writer Writer io.Writer // contains filtered or unexported fields }
PtyShell struct for pty dialer.
func NewPtyShell ¶
NewPtyDialer returns new pty dialer struct.
func (*PtyShell) ChangeWindowSize ¶
func (d *PtyShell) ChangeWindowSize(win hosts.ShellWindowSize) error
ChangeWindowSize changes to the current window size.
func (*PtyShell) OpenTerminal ¶
func (d *PtyShell) OpenTerminal(win hosts.ShellWindowSize) error
OpenTerminal open pty websocket terminal.
type SSHDialer ¶
type SSHDialer struct {
// contains filtered or unexported fields
}
SSHDialer struct for ssh dialer.
func NewSSHDialer ¶
NewSSHDialer returns new ssh dialer.
func (*SSHDialer) ExecuteCommands ¶
type SSHShell ¶
type SSHShell struct { Stdin io.ReadCloser Stdout io.Writer Stderr io.Writer Writer io.Writer Term string Modes ssh.TerminalModes // contains filtered or unexported fields }
func (*SSHShell) ChangeWindowSize ¶
func (d *SSHShell) ChangeWindowSize(win hosts.ShellWindowSize) error
ChangeWindowSize change the window size for current session.
func (*SSHShell) OpenTerminal ¶
func (d *SSHShell) OpenTerminal(win hosts.ShellWindowSize) error
OpenTerminal starts a login shell on the remote host.
func (*SSHShell) SetIO ¶
func (d *SSHShell) SetIO(stdout, stderr io.Writer, stdin io.ReadCloser)
SetIO set dialer's reader and writer.