Documentation
¶
Overview ¶
Code generated by apic; DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = errors.New("not implemented")
ErrNotImplemented is returned by UnimplementedWSServer methods.
Functions ¶
func RegisterGeneratedWS ¶
func RegisterGeneratedWS(mux *http.ServeMux, srv WSServerInterface, opts WSOptions)
RegisterGeneratedWS registers WebSocket endpoints; srv handles business logic.
GAP-0076: when the configuration declares at least one WebSocket endpoint with auth: "jwt" but the caller supplied a nil opts.AuthJWT, this function panics with a fmt.Errorf wrapping securex.ErrAuthVerifierRequired BEFORE any endpoint is registered. The same guard fires for auth: "api_key" + nil opts.Auth via securex.ErrAuthAPIKeyRequired. Use securex.NewTestVerifier() as the unit-test escape hatch.
func WithWSLimiter ¶
WithWSLimiter installs a custom *wsx.Limiter for a single path. Pass to the caller's option-builder when assembling WSOptions. The override survives ws.go.tmpl regeneration: a consumer that wires a Redis-backed cap need not patch the template. GAP-0075.
Types ¶
type UnimplementedWSServer ¶
type UnimplementedWSServer struct{}
UnimplementedWSServer returns ErrNotImplemented for every WebSocket endpoint.
type WSOptions ¶
type WSOptions struct {
Auth func(*http.Request) error
AuthJWT func(*http.Request) error
// Limiters is an optional per-path override of the auto-built
// process-local *wsx.Limiter. Use to wire e.g. a Redis-backed
// limiter for cross-pod accounting. A path not present in the map
// gets the auto-built limiter. GAP-0075.
Limiters map[string]*wsx.Limiter
}
WSOptions configures cross-cutting concerns for WebSocket endpoints.
type WSServerInterface ¶
WSServerInterface defines the business logic contract for generated WebSocket endpoints. Embed UnimplementedWSServer and override only the endpoints you need.