type

HandlerOptions

type HandlerOptions struct { developmentReadiness bool allowUnverifiableReadiness bool // AdminAssets overrides the framework's embedded admin asset filesystem. AdminAssets fs.FS // MaxBodyBytes limits decoded request bodies. Zero uses the framework default. MaxBodyBytes int64 // SecureCookies restricts auth cookies to HTTPS requests. SecureCookies bool // AllowedOrigins lists browser origins permitted by CORS. AllowedOrigins []string // AllowedRequestHeaders appends application-owned CORS request headers to // Ridu's SDK headers. Invalid HTTP token names are ignored. AllowedRequestHeaders []string // AllowedHosts restricts the HTTP Host header. Entries are exact hostnames // with an optional port; an entry without a port accepts any port. Empty // accepts every syntactically valid host for development. Production // deployments should set their public hostnames. AllowedHosts []string // TrustedProxyCIDRs lists proxies whose forwarded client addresses are trusted. TrustedProxyCIDRs []string // AuthRateLimit is the maximum auth attempts per identity and client window. AuthRateLimit int // AuthRateWindow is the duration over which AuthRateLimit is enforced. AuthRateWindow time.Duration // Audit receives security-relevant application events. Audit func(AuditEvent) // Observe receives timing and status metadata for completed requests. Observe func(RequestObservation) // RequestError receives trusted diagnostic detail for internal failures and // recovered panics. The HTTP response remains redacted. RequestError func(RequestErrorEvent) // RequestTimeout limits request execution. Zero uses the framework default; // a negative duration disables the handler deadline for streaming plugins. RequestTimeout time.Duration // ReadinessChecks add application/plugin dependencies to /readyz. Checks // must be read-only, repeatable, and honor Context cancellation. ReadinessChecks []ReadinessCheck // ReadinessTimeout bounds the complete database, storage, and custom // readiness probe. Zero uses five seconds; a negative duration disables it. ReadinessTimeout time.Duration // ContentSecurityPolicy overrides the framework admin policy. Empty uses a // conservative default compatible with live-preview frames. ContentSecurityPolicy string // DisableContentSecurityPolicy explicitly disables the admin CSP when an // upstream gateway owns it. DisableContentSecurityPolicy bool // StrictTransportSecurity is emitted verbatim when non-empty. Configure it // only when every public request is HTTPS, normally at the TLS terminator. StrictTransportSecurity string // TaskInterval controls how often the durable task queues are polled. Zero // uses the framework default. TaskInterval time.Duration // TaskBatch limits durable task leases claimed during one polling cycle. TaskBatch int // TaskQueues optionally restricts this process to named queues. An empty // list consumes every queue, including unknown task slugs so they can be // moved to a stable terminal failure. TaskQueues []string // TaskLeaseDuration is extended by heartbeats while a handler is running. TaskLeaseDuration time.Duration // TaskHeartbeatInterval must remain shorter than TaskLeaseDuration. TaskHeartbeatInterval time.Duration // TaskPruneBatch bounds terminal records removed after their retention. TaskPruneBatch int // AuthPruneBatch bounds expired sessions and API keys removed from each // durable credential family during one background maintenance cycle. AuthPruneBatch int // JobError receives failures from scheduled background work. JobError func(error) }

HTTP API, embedded admin, observability, security, and worker configuration.

Source core/http.go:25

@param AdminAssets
Overrides the framework’s embedded admin asset filesystem.
@param MaxBodyBytes
Limits decoded request bodies; zero uses the framework default.
@param SecureCookies
Restricts authentication cookies to HTTPS requests.
@param AllowedOrigins
Lists browser origins permitted by credentialed CORS.
@param AllowedRequestHeaders
Appends application-owned CORS request headers; invalid HTTP token names are ignored.
@param AllowedHosts
Restricts Host to exact hostnames with optional ports; empty accepts syntactically valid development hosts.
@param TrustedProxyCIDRs
Lists proxies whose forwarded client addresses may be trusted.
@param AuthRateLimit
Sets maximum auth attempts per identity and client window.
@param AuthRateWindow
Sets the auth-attempt window.
@param Audit
Receives security-relevant application events.
@param Observe
Receives timing and status metadata for completed requests.
@param RequestError
Receives trusted diagnostic detail while public responses remain redacted.
@param RequestTimeout
Limits request execution; zero uses the default and a negative value disables the bound.
@param ReadinessChecks
Adds read-only repeatable dependencies to /readyz.
@param ReadinessTimeout
Bounds the complete readiness probe; zero uses five seconds and a negative value disables it.
@param ContentSecurityPolicy
Overrides the embedded admin CSP.
@param DisableContentSecurityPolicy
Disables CSP when an upstream gateway owns it.
@param StrictTransportSecurity
Emits the configured HSTS value when every public request is HTTPS.
@param TaskInterval
Controls durable-task polling frequency.
@param TaskBatch
Limits leases claimed during one polling cycle.
@param TaskQueues
Restricts this process to named worker queues; empty consumes every queue.
@param TaskLeaseDuration
Sets the lease extended while a handler runs.
@param TaskHeartbeatInterval
Sets heartbeat cadence and must be shorter than the lease.
@param TaskPruneBatch
Bounds expired terminal task records removed per cycle.
@param AuthPruneBatch
Bounds expired sessions and API keys removed per maintenance cycle.
@param JobError
Receives failures from scheduled background work.

Pass this value to App.Handler when embedding Ridu, or install it with WithHandlerOptions when Execute owns the server.

Related types