Versions in this module Expand all Collapse all v1 v1.0.0 Aug 6, 2026 Changes in this version + var ErrClosed = errors.New("server closed") + type Event struct + Collection string + Doc map[string]any + Event string + ID string + SubID string + type Hub struct + func NewHub() *Hub + func (h *Hub) Publish(event Event) + func (h *Hub) Subscribe(collection string) (string, <-chan Event) + func (h *Hub) Unsubscribe(id string) + type Options struct + Addr string + AllowedIPs []string + CORSEnabled bool + CORSOrigins []string + IPCheck bool + Logger *zap.Logger + MaxBodyBytes int64 + RateLimitBurst int + RateLimitEnabled bool + RateLimitRPS int + Store docstore.Store + Token string + WSEnabled bool + WSIdleTimeout time.Duration + WSMaxMessageBytes int64 + WSMaxSubscriptions int + type Server struct + func New(opts Options) *Server + func (s *Server) ListenAndServe() error + func (s *Server) Mount(mux *http.ServeMux) + func (s *Server) Shutdown(ctx context.Context) error