Documentation
¶
Overview ¶
Package dashboard exposes the BaQueue dashboard as a standard HTTP handler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a handler usable with net/http, Gin's WrapH or Echo's WrapHandler. The caller owns the driver's connection and lifecycle. New starts no goroutines; live-feed goroutines run only while clients are connected. Configure WithAuth before exposing this administrative handler outside a trusted network.
Types ¶
type Option ¶
type Option func(*config)
Option configures the dashboard handler.
func WithAuth ¶
WithAuth wraps all routes, including assets and WebSocket handshakes. The middleware must preserve http.Hijacker support for WebSocket requests.
func WithContext ¶
WithContext binds live feeds to ctx. Cancellation closes WebSockets, stops the overview broadcaster, and rejects new WebSocket handshakes. REST requests retain their own contexts so http.Server.Shutdown can drain them gracefully. The caller still owns the driver's lifecycle and must wait for handlers to return before disconnecting it.
func WithOriginPatterns ¶
WithOriginPatterns permits additional WebSocket origin hosts using coder/websocket's host-pattern syntax. By default only the request host is accepted. Never use "*" for a dashboard authenticated with cookies.
func WithPrefix ¶
WithPrefix mounts every route under prefix (for example, "/baqueue"). Register the returned handler at prefix and prefix+"/" without StripPrefix. Alternatively, use http.StripPrefix with New(driver) and no WithPrefix.
func WithRefreshIntervals ¶
WithRefreshIntervals overrides the default 2s overview and 1.5s jobs feeds.