wsutil

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecReaderToChannel

func ExecReaderToChannel(r io.Reader, bufferSize int, exited <-chan struct{}, fd int) <-chan []byte

Extensively commented directly in the code. Please leave the comments! Looking at this in a couple of months noone will know why and how this works anymore.

func GetPollRevents

func GetPollRevents(fd int, timeout int, flags int) (int, int, error)

GetPollRevents poll for events on provided fd.

func MirrorToWebsocket

func MirrorToWebsocket(conn MessageWriter, r io.ReadCloser, exited chan struct{}, fd int)

MirrorToWebsocket mirrors PTY output from r (file descriptor fd) to the websocket.

func ReaderToChannel

func ReaderToChannel(r io.Reader, bufferSize int) <-chan []byte

func WebsocketRecvStream

func WebsocketRecvStream(w io.Writer, conn MessageReader) chan bool

func WebsocketSendStream

func WebsocketSendStream(conn MessageWriter, r io.Reader, bufferSize int) chan bool

Types

type MessageReadWriter

type MessageReadWriter interface {
	MessageReader
	MessageWriter
}

MessageReadWriter is an interface that wraps websocket message reading and writing.

type MessageReader

type MessageReader interface {
	NextReader() (messageType int, r io.Reader, err error)
}

MessageReader is an interface that wraps websocket message reading.

type MessageWriter

type MessageWriter interface {
	WriteMessage(messageType int, data []byte) error
}

MessageWriter is an interface that wraps websocket message writing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL