taskcluster-worker: github.com/taskcluster/taskcluster-worker/plugins/interactive/shellclient Index | Files

package shellclient

import "github.com/taskcluster/taskcluster-worker/plugins/interactive/shellclient"

Package shellclient provides a wrapper for demuxing a shell websocket and exposing the stdout/stderr streams as well as offering a way to provide the stdin stream.

Index

Package Files

dialshell.go doc.go shellclient.go

type ShellClient Uses

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

ShellClient exposes the client interface to a shell running remotely. This object implements the engines.Shell interface.

func Dial Uses

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

Dial will open a websocket to socketURL giving command and tty to the server. If no command is given the server should open its default shell in a human usable configuration.

func New Uses

func New(ws *websocket.Conn) *ShellClient

New takes a websocket and creates a ShellClient object implementing the engines.Shell interface.

func (*ShellClient) Abort Uses

func (s *ShellClient) Abort() error

Abort will tell the remote shell to abort and close the websocket.

func (*ShellClient) SetSize Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

Wait will wait for the remote shell to finish, by either succeeding or returning an error.

Package shellclient imports 13 packages (graph) and is imported by 3 packages. Updated 2017-03-18. Refresh now. Tools for package owners.