Documentation
¶
Index ¶
- func BootstrapHandler(wsURL string, tokenProvider func() string) http.HandlerFunc
- func ClientCount() int
- func Connect(w http.ResponseWriter, r *http.Request, handler MessageHandler) (*websocket.Conn, error)
- func HasClient(applicationName string) bool
- func RequireAPIKey(tokenProvider func() string) func(http.Handler) http.Handler
- type BootstrapResponse
- type ConnectRequest
- type MessageHandler
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.
Types ¶
type BootstrapResponse ¶ added in v0.0.35
type ConnectRequest ¶
type ConnectRequest struct {
ApplicationName string `json:"application_name"`
}
Click to show internal directories.
Click to hide internal directories.