Documentation
¶
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 *Element)
What what.What // what to change or do
Data string // data (e.g. inner HTML content or slice of tags)
}
Message contains the elements of a message to be sent to requests.
Click to show internal directories.
Click to hide internal directories.