Documentation
¶
Overview ¶
Package httpapi exposes the HTTP adapter for DeltaScope. input: parsed HTTP audit requests, shared metadata-preparation helpers, and public audit execution functions output: additive HTTP audit context plus offline or metadata-aware audit execution results pos: HTTP adapter glue between request-scoped metadata inputs and the public DeltaScope audit API note: if this file changes, update this header and module README.md.
Package httpapi exposes the HTTP adapter for DeltaScope. input: HTTP requests carrying SQL audit payloads plus service-level config/version wiring output: JSON audit, health, readiness, version, structured error responses, and structured access log lines pos: interface adapter between net/http and the public DeltaScope audit API note: if this file changes, update this header and module README.md.
Package httpapi exposes the HTTP adapter for DeltaScope. input: listen addresses plus service-level config/version wiring output: ready-to-run HTTP server instances for the JSON audit service pos: long-running net/http server assembly for the HTTP interface milestone note: if this file changes, update this header and module README.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(configPath, version string, opts ...HandlerOption) (http.Handler, error)
NewHandler returns the JSON HTTP adapter for DeltaScope.
Types ¶
type AuthConfig ¶ added in v0.10.0
AuthConfig controls API-key authentication on the HTTP adapter.
type HandlerOption ¶ added in v0.10.0
type HandlerOption func(*handlerOptions)
HandlerOption configures NewHandler behavior.
func WithAuditFunc ¶ added in v0.10.0
func WithAuditFunc(fn func(context.Context, deltascope.Request) (deltascope.Result, error)) HandlerOption
WithAuditFunc overrides the audit execution function (primarily for tests).
func WithAuthConfig ¶ added in v0.10.0
func WithAuthConfig(cfg AuthConfig) HandlerOption
WithAuthConfig enables API-key authentication on selected routes.
func WithMiddlewareConfig ¶ added in v0.10.0
func WithMiddlewareConfig(cfg MiddlewareConfig) HandlerOption
WithMiddlewareConfig overrides default middleware settings.
type MiddlewareConfig ¶ added in v0.10.0
type MiddlewareConfig struct {
RequestTimeout time.Duration
Logger *log.Logger
RateLimit RateLimitConfig
MetricsEnabled *bool
TrustedProxies []string
}
MiddlewareConfig controls default middleware behavior.