extension

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapHandler added in v0.0.35

func BootstrapHandler(wsURL string, tokenProvider func() string) http.HandlerFunc

func ClientCount

func ClientCount() int

ClientCount returns the number of currently connected clients.

func Connect

func Connect(w http.ResponseWriter, r *http.Request, handler MessageHandler) (*websocket.Conn, error)

Connect upgrades the request to websocket and tracks the client. When the connection is lost, the client is removed from the hub.

func HasClient

func HasClient(applicationName string) bool

func RequireAPIKey added in v0.0.35

func RequireAPIKey(tokenProvider func() string) func(http.Handler) http.Handler

Types

type BootstrapResponse added in v0.0.35

type BootstrapResponse struct {
	WSURL   string `json:"ws_url"`
	APIKey  string `json:"api_key"`
	Version string `json:"version"`
}

type ConnectRequest

type ConnectRequest struct {
	ApplicationName string `json:"application_name"`
}

type MessageHandler added in v0.0.35

type MessageHandler func(applicationName string, conn *websocket.Conn, payload []byte) error

Jump to

Keyboard shortcuts

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