Versions in this module Expand all Collapse all v1 v1.0.0 Oct 25, 2026 Changes in this version + const CodeForbidden + const CodeNotAllowed + const CodeServiceError + const CodeServiceUnavailable + const CodeTooManyRequests + const CodeUnauthorized + const DefaultMaxFilters + const DefaultMaxInValues + const DefaultTimeout + const DisableCreate + const DisableDelete + const DisableFilters + const DisableList + const DisableRead + const DisableUpdate + const EnableMatchFilters + const RequestIDHeader + var ErrNoCredentials = errors.New("no credentials") + func Bearer(verify func(ctx context.Context, token string) (any, error)) func(r *http.Request) (any, error) + func BearerToken(r *http.Request) (string, bool) + func ClientIP(r *http.Request, trustedProxies []netip.Prefix) netip.Addr + func ClientIPKey(addr netip.Addr) string + func Liveness(w http.ResponseWriter, _ *http.Request) + func LogHandler(next slog.Handler) slog.Handler + func Principal(ctx context.Context) any + func RequestID(ctx context.Context) string + type FilterSet struct + Ops map[string]string + Vals map[string]string + type Handler struct + func New(reg Registry, options Options) *Handler + func (h *Handler) OpenAPI(info OpenAPIInfo) ([]byte, error) + func (h *Handler) Readiness(check func(ctx context.Context) error) http.HandlerFunc + func (h *Handler) RoutePath(r *http.Request) string + func (h *Handler) Serve(w http.ResponseWriter, r *http.Request) + type OpenAPIInfo struct + BearerFormat string + Description string + Servers []string + Title string + Version string + type Options struct + AccessLog bool + AllowUnknownFields bool + Authenticate func(r *http.Request) (any, error) + CacheControl string + DisableSecurityHeaders bool + HSTSMaxAge time.Duration + Logger *slog.Logger + MaxBodyBytes int64 + MaxFilters int + MaxInValues int + MeterProvider metric.MeterProvider + ProblemTypeBaseURL string + RateLimitKey func(r *http.Request) string + RateLimiter RateLimiter + Routes map[string]Route + Timeout time.Duration + TracerProvider trace.TracerProvider + TrustedProxies []netip.Prefix + UserIDFunc func(r *http.Request) any + type RateLimiter interface + Allow func(ctx context.Context, key string) (bool, time.Duration, error) + func NewRateLimiter(perSecond float64, burst int) RateLimiter + type Registry interface + Delete func(ctx context.Context, key string, id any) error + ID func(obj any) any + List func(ctx context.Context, key string, options registry.ListOptions) ([]any, error) + New func(key string) any + NextCursor func(obj any, order string, orderDirection string) (string, error) + PasswordFieldNames func(key string) []string + Read func(ctx context.Context, key string, id any, constructor func() any) (any, error) + RelatedType func(obj any, field string) (reflect.Type, bool) + Save func(ctx context.Context, obj any, userID any) error + type Route struct + AllowCreate func(obj any, r *http.Request) error + AllowDelete func(obj any, r *http.Request) error + AllowRead func(obj any, r *http.Request) error + AllowUpdate func(obj any, r *http.Request) error + AllowedFilters []string + Anonymous bool + CreateConstructor func() any + FilterList func(r *http.Request) FilterSet + FilterRead func(r *http.Request) FilterSet + Flags int64 + ListConstructor func() any + PostListItem func(obj any, r *http.Request) error + PostRead func(obj any, r *http.Request) error + PreCreate func(obj any, r *http.Request) error + PreUpdate func(obj any, r *http.Request) error + ReadConstructor func() any + RegistryKey string + UpdateConstructor func() any v1.0.0-rc.1 Oct 25, 2026