{"modulePath":"github.com/taskcluster/taskcluster-worker","version":"v0.1.20","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package displayclient\n\nPackage displayclient provides a golang implementation of websockify, transforming a websocket connection to an ioext.ReadWriteCloser object.\n\nThe 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.\n\n## Types\n\n```go\ntype Display struct {\n\tdisplayconsts.DisplayEntry\n\t// contains filtered or unexported fields\n}\n```\nA Display structure holds information about a display returned from ListDisplays()\n\n```go\nfunc ListDisplays(socketURL string) ([]Display, error)\n```\nListDisplays will fetch a list of displays offered by the socketURL.\n\n```go\nfunc (d Display) OpenDisplay() (*DisplayClient, error)\n```\nOpenDisplay will attempt to open a websocket and create a DisplayClient for the display.\n\n```go\ntype DisplayClient struct {\n\t// contains filtered or unexported fields\n}\n```\nDisplayClient implements io.Reader, io.Writer and io.Closer for a VNC connection over a websocket. Similar to websockify.\n\n```go\nfunc Dial(socketURL string, display string) (*DisplayClient, error)\n```\nDial will open a websocket to socketURL, pass the display string to the server and return a DisplayClient implementing ioext.ReadWriteCloser using the websocket.\n\nUse ListDisplays() to find available displays.\n\n```go\nfunc New(ws *websocket.Conn) *DisplayClient\n```\nNew returns a new display client implementing the ioext.ReadWriteCloser interface using a websocket.\n\nThe 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.\n\n```go\nfunc (c *DisplayClient) Close() error\n```\nClose will close the underlying websocket and release all resources held by the DisplayClient.\n\n```go\nfunc (c *DisplayClient) Read(p []byte) (int, error)\n```\n\n```go\nfunc (c *DisplayClient) Write(p []byte) (int, error)\n```\n\n","path":"github.com/taskcluster/taskcluster-worker/plugins/interactive/displayclient","name":"displayclient","synopsis":"Package displayclient provides a golang implementation of websockify, transforming a websocket connection to an ioext.ReadWriteCloser object.","isRedistributable":true}
