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

package displayclient

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

Package displayclient provides a golang implementation of websockify, transforming a websocket connection to an ioext.ReadWriteCloser object.

The goal of this is to make it easy to interact with a VNC connection from a go application. Both for writing tests and command line utilities.

Index

Package Files

dialdisplay.go displayclient.go doc.go listdisplays.go

func ListDisplays Uses

func ListDisplays(socketURL string) ([]Display, error)

ListDisplays will fetch a list of displays offered by the socketURL.

type Display Uses

type Display struct {
    displayconsts.DisplayEntry
    // contains filtered or unexported fields
}

A Display structure holds information about a display returned from ListDisplays()

func (Display) OpenDisplay Uses

func (d Display) OpenDisplay() (*DisplayClient, error)

OpenDisplay will attempt to open a websocket and create a DisplayClient for the display.

type DisplayClient Uses

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

DisplayClient implements io.Reader, io.Writer and io.Closer for a VNC connection over a websocket. Similar to websockify.

func Dial Uses

func Dial(socketURL string, display string) (*DisplayClient, error)

Dial will open a websocket to socketURL, pass the display string to the server and return a DisplayClient implementing ioext.ReadWriteCloser using the websocket.

Use ListDisplays() to find available displays.

func New Uses

func New(ws *websocket.Conn) *DisplayClient

New returns a new display client implementing the ioext.ReadWriteCloser interface using a websocket.

The DisplayClient essentially takes care of sending and receiving ping/pongs to keep the websocket alive. However, the DisplayClient does read/write directly on websocket without any buffering, hence, you must keep calling Read() with a non-empty buffer to keep the connection alive.

func (*DisplayClient) Close Uses

func (c *DisplayClient) Close() error

Close will close the underlying websocket and release all resources held by the DisplayClient.

func (*DisplayClient) Read Uses

func (c *DisplayClient) Read(p []byte) (int, error)

func (*DisplayClient) Write Uses

func (c *DisplayClient) Write(p []byte) (int, error)

Package displayclient imports 11 packages (graph). Updated 2016-11-04. Refresh now. Tools for package owners.