ws

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebSocketChannels

type WebSocketChannels interface {
	GetChannels(topic string) (senderChannel chan<- interface{}, broadcastChannel chan<- interface{}, receiverChannel <-chan *WebSocketCommandMessageOrError)
	SendReply(message interface{})
}

WebSocketChannels is provided to allow us to do a blocking send to a namespace that will complete once a client connects on it We also provide a channel to listen on for closing of the connection, to allow a select to wake on a blocking send

type WebSocketCommandMessage

type WebSocketCommandMessage struct {
	Type        string `json:"type,omitempty"`
	Topic       string `json:"topic,omitempty"`  // synonym for "topic" - from a time when we let you configure the topic separate to the stream name
	Stream      string `json:"stream,omitempty"` // name of the event stream
	Message     string `json:"message,omitempty"`
	BatchNumber int64  `json:"batchNumber,omitempty"`
}

type WebSocketCommandMessageOrError

type WebSocketCommandMessageOrError struct {
	Msg *WebSocketCommandMessage
	Err error
}

type WebSocketServer

type WebSocketServer interface {
	WebSocketChannels
	Handler(w http.ResponseWriter, r *http.Request)
	Close()
}

WebSocketServer is the full server interface with the init call

func NewWebSocketServer

func NewWebSocketServer(bgCtx context.Context) WebSocketServer

NewWebSocketServer create a new server with a simplified interface

Jump to

Keyboard shortcuts

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