Versions in this module Expand all Collapse all v0 v0.1.1 Feb 21, 2024 Changes in this version + func WriteStatus(conn Conn, status Status, message string, body interface{}) error + type Status string + var StatusError Status = "error" + var StatusOK Status = "ok" + type StatusBody struct + Body interface{} + Message string + Status Status v0.1.0 Nov 13, 2023 Changes in this version + type Conn interface + Close func() error + ReadJSON func(p interface{}) error + RemoteAddr func() net.Addr + WriteJSON func(p interface{}) error + type Key string + type Store map[Conn][]Key + func NewStore() Store + func (s Store) AddNewJob(ws Conn) (Key, error) + func (s Store) GetWebsocket(key Key) (Conn, error) + func (s Store) Register(ws Conn) error + func (s Store) Unregister(ws Conn) error + type Websocket interface + IsClosed func(err error) bool + Upgrade func(w http.ResponseWriter, r *http.Request, h http.Header) (Conn, error) + func NewWebsocket(opt WebsocketOptions) (Websocket, error) + type WebsocketOptions struct + Origins []string