Documentation ¶
Overview ¶
This package was originally designed to have 3 channels for reading that represented stdin, stdout, stderr, also a channel that contained the exit code. Additional channels can be created by the user.
Index ¶
- Constants
- func PackMessage(channel int, data []byte) []byte
- func UnpackMessage(frame []byte) (int, []byte, error)
- type MessageFrame
- type WSReadWriter
- type WSReader
- type WSStream
- func (ws *WSStream) CloseAndCleanup() error
- func (ws *WSStream) Closed() <-chan struct{}
- func (ws *WSStream) ReadMsg() <-chan []byte
- func (ws *WSStream) StartReader()
- func (ws *WSStream) StartWriteLoop()
- func (ws *WSStream) WriteMsg(channel int, msg []byte) error
- func (ws *WSStream) WriteRaw(framedMsg []byte) error
- type WSWriter
- type WebsocketParams
Constants ¶
View Source
const ( StdinChan int = 0 StdoutChan int = 1 StderrChan int = 2 ExitCodeChan int = 3 )
Variables ¶
This section is empty.
Functions ¶
func PackMessage ¶
Types ¶
type MessageFrame ¶
type MessageFrame []byte
type WSReadWriter ¶
type WSReadWriter struct { *WSStream // contains filtered or unexported fields }
func (*WSReadWriter) CreateReader ¶
func (ws *WSReadWriter) CreateReader(channel int) *WSReader
func (*WSReadWriter) CreateWriter ¶
func (ws *WSReadWriter) CreateWriter(channel int) *WSWriter
func (*WSReadWriter) RunDispatch ¶
func (ws *WSReadWriter) RunDispatch()
type WSStream ¶
type WSStream struct {
// contains filtered or unexported fields
}
func NewWSStream ¶
func (*WSStream) CloseAndCleanup ¶
CloseAndCleanup MUST be called. Should be called by the user of the stream in response to hearing about the close from selecting on Closed(). Should only be called once but MUST be called by the user of the WSStream or else we'll leak the open WS connection.
func (*WSStream) StartReader ¶
func (ws *WSStream) StartReader()
func (*WSStream) StartWriteLoop ¶
func (ws *WSStream) StartWriteLoop()
type WebsocketParams ¶
type WebsocketParams struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.