Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Protocol ws.Protocol[Message] = protocol{}
Functions ¶
Types ¶
type CloseMessage ¶
type CloseMessage struct {
Reason string
}
A message indicating the connection is complete.
func (CloseMessage) Type ¶
func (i CloseMessage) Type() MessageType
type DataMessage ¶
type DataMessage struct {
Data []byte
}
type ErrorMessage ¶
type ErrorMessage struct {
Message string
}
Send an error to the client. Used before closing the connection.
func (ErrorMessage) Type ¶
func (i ErrorMessage) Type() MessageType
type HandshakeMessage ¶
type HandshakeMessage struct { Env map[string]string Shell string Size geom.Vec2 Profile termenv.Profile }
The initial information necessary to render to the client.
func (HandshakeMessage) Type ¶
func (i HandshakeMessage) Type() MessageType
type InputMessage ¶
type InputMessage DataMessage
Represents client input (typically, typing.)
func (InputMessage) Type ¶
func (i InputMessage) Type() MessageType
type Message ¶
type Message interface {
Type() MessageType
}
type MessageType ¶
type MessageType int
const ( MessageTypeHandshake MessageType = iota MessageTypeError MessageTypeSize MessageTypeInput MessageTypeOutput MessageTypeClose )
type OutputMessage ¶
type OutputMessage DataMessage
Output that should be sent to the client.
func (OutputMessage) Type ¶
func (i OutputMessage) Type() MessageType
type SizeMessage ¶
Used when the client terminal is resized.
func (SizeMessage) Type ¶
func (i SizeMessage) Type() MessageType
func (SizeMessage) Vec ¶ added in v0.1.13
func (i SizeMessage) Vec() geom.Vec2
Click to show internal directories.
Click to hide internal directories.