Documentation
¶
Overview ¶
Package wire formats and parses the line-based JaWS WebSocket protocol.
Index ¶
- func PingLoop(ctx context.Context, ccf context.CancelCauseFunc, doneCh <-chan struct{}, ...)
- func ReadLoop(ctx context.Context, ccf context.CancelCauseFunc, doneCh <-chan struct{}, ...)
- func WriteLoop(ctx context.Context, ccf context.CancelCauseFunc, doneCh <-chan struct{}, ...)
- type Message
- type WsMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PingLoop ¶ added in v0.300.2
func PingLoop(ctx context.Context, ccf context.CancelCauseFunc, doneCh <-chan struct{}, interval, timeout time.Duration, ws *websocket.Conn)
PingLoop sends periodic WebSocket pings and reports ping errors through ccf.
Returns immediately when interval is non-positive.
Types ¶
type Message ¶
type Message struct {
Dest any // destination tag, HTML ID or *jaws.Element
What what.What // command to perform
Data string // payload, such as inner HTML content or a slice of tags
}
Message contains the elements of a message to be sent to requests.
type WsMsg ¶
type WsMsg struct {
Data string // data to send
Jid jid.Jid // Jid to send, or -1 if Data contains that already
What what.What // command
}
WsMsg is a message sent to or from a WebSocket.
Click to show internal directories.
Click to hide internal directories.