{"modulePath":"github.com/taskcluster/taskcluster-worker","version":"v0.1.20","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package shellconsts\n\nPackage shellconsts contains constants shared between shell server and client which is split into different packages to reduce the binary size of potential commandline clients.\n\n## Constants\n\n```go\nconst (\n\tMessageTypeData  = 0\n\tMessageTypeAck   = 1\n\tMessageTypeSize  = 3\n\tMessageTypeAbort = 4\n\tMessageTypeExit  = 5\n\tStreamStdin      = 0\n\tStreamStdout     = 1\n\tStreamStderr     = 2\n)\n```\nMessage type codes for websocket messages implementing interactive shell.\n\nWe will send stdin, stdout, stderr, exit and abort messages over a websocket. Messages will all have the form: \\[type] \\[data]\n\nWhere \\[type] is a single byte with the value of MessageTypeData MessageTypeAbort or MessageTypeExit. The data property depends on the \\[type] of the message, as outlined below.\n\nIf \\[type] is MessageTypeData then\n\n\t[data] = [stream] [payload]\n\n, where  \\[stream] is a single byte: StreamStdin, StreamStdout, StreamStderr, and \\[payload] is data from this stream. If \\[payload] is an empty byte sequence this signals the end of the stream.\n\nIf \\[type] is MessageTypeAck then\n\n\t[data] = [stream] [N]\n\n, where \\[stream] is a single byte: StreamStdin, StreamStdout, StreamStderr, and \\[N] is a big-endian 32 bit unsigned integer acknowleging the remote stream to have processed N bytes.\n\nIf \\[type] is MessageTypeAbort then \\[data] is empty, this message is used to request that the executing be aborted.\n\nIf \\[type] is MessageTypeExit then \\[data] = \\[exitCode], where exitCode is a single byte 0 (success) or 1 (failed) indicating whether the command terminated successfully.\n\nIf \\[type] is MessageTypeSize then\n\n\t[data] = [colmns] [rows]\n\n, where \\[colmns] and \\[rows] are big-endian 16 bit unsigned integers specifying the width and height of the TTY. If not supported this message is is ignored.\n\n```go\nconst (\n\t// ShellHandshakeTimeout is the maximum allowed time for websocket handshake\n\tShellHandshakeTimeout = 30 * time.Second\n\t// ShellPingInterval is the time between sending pings\n\tShellPingInterval = 15 * time.Second\n\t// ShellWriteTimeout is the maximum time between successful writes\n\tShellWriteTimeout = ShellPingInterval * 2\n\t// ShellPongTimeout is the maximum time between successful reads\n\tShellPongTimeout = ShellPingInterval * 3\n\t// ShellBlockSize is the maximum number of bytes to send in a single block\n\tShellBlockSize = 16 * 1024\n\t// ShellMaxMessageSize is the maximum message size we will read\n\tShellMaxMessageSize = ShellBlockSize + 4*1024\n\t// ShellMaxPendingBytes is the maximum number of bytes allowed in-flight\n\tShellMaxPendingBytes = 4 * ShellBlockSize\n)\n```\n\n","path":"github.com/taskcluster/taskcluster-worker/plugins/interactive/shellconsts","name":"shellconsts","synopsis":"Package shellconsts contains constants shared between shell server and client which is split into different packages to reduce the binary size of potential commandline clients.","isRedistributable":true}
