dockerExecWS

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dockerExecWS provides a golang client implementation for the websocket protocol implemented in the npm package "docker-exec-websocket-server". This is a websocket protocol for exposing "docker exec" to a remote process.

Index

Constants

View Source
const (
	// MaxOutstandingBytes is the maximum number of unsent bytes in the stdin buffer.
	MaxOutstandingBytes = 8 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ShellClient

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

ShellClient is the implementation of github.com/taskcluster/taskcluster-worker/engines.Shell for v1 shells.

func Dial

func Dial(socketURL string, command []string, tty bool) (*ShellClient, error)

Dial will built a proper shell websocket URL, connect to the server and return an initialized shell client.

func New

func New(ws *websocket.Conn) *ShellClient

New creates a new v1 ShellClient from an existing websocket.

func (*ShellClient) Abort

func (s *ShellClient) Abort() error

Abort will forcibly disconnect and terminate the shell client.

func (*ShellClient) SetSize

func (s *ShellClient) SetSize(columns, rows uint16) error

SetSize will attempt to set the TTY width (columns) and height (rows) on the remote shell.

func (*ShellClient) StderrPipe

func (s *ShellClient) StderrPipe() io.ReadCloser

StderrPipe returns a pipe from which stderr must be read. It's important to drain this pipe or the shell will block when the internal buffer is full.

func (*ShellClient) StdinPipe

func (s *ShellClient) StdinPipe() io.WriteCloser

StdinPipe returns a pipe to which stdin must be written. It's important to close stdin, if you expect the remote shell to terminate.

func (*ShellClient) StdoutPipe

func (s *ShellClient) StdoutPipe() io.ReadCloser

StdoutPipe returns a pipe from which stdout must be read. It's important to drain this pipe or the shell will block when the internal buffer is full.

func (*ShellClient) Wait

func (s *ShellClient) Wait() (bool, error)

Wait waits until the shell client exits.

Jump to

Keyboard shortcuts

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