Skip to main content

Crate doido_controller

Crate doido_controller 

Source

Re-exports§

pub use config::Config;
pub use config::ServerConfig;
pub use config::YamlConfig;
pub use context::Context;
pub use context::IntoActionResponse;
pub use cookies::CookieJar;
pub use flash::Flash;
pub use params::Params;
pub use rescue::RescueHandlers;
pub use response::Response;
pub use route_table::all_routes;
pub use route_table::print_routes;
pub use route_table::register_routes;
pub use route_table::RouteEntry;
pub use server::start_server;
pub use server::start_server_with;
pub use session::CacheSessionStore;
pub use session::CookieSessionStore;
pub use session::EncryptedCookieSessionStore;
pub use session::Session;
pub use session::SessionStore;
pub use stack::MiddlewareStack;
pub use axum;

Modules§

config
Per-environment application configuration loaded from config/<env>.yml.
constraints
Route/param constraints (Rails constraints: { id: /\d+/ }).
context
cookies
A request/response cookie jar with plain and signed cookies (Rails cookies[...] / cookies.signed[...]).
csrf
CSRF protection via the double-submit-cookie pattern.
env_override
Environment-variable config overrides (spec 05 SECTION__KEY).
flash
Flash messages: values set on one request and read on exactly the next one.
health
Health-check endpoint (Rails 8 GET /up): returns 200 when the app boots.
initializers
Boot-time initializers (Rails config/initializers/*). Since initializers are code, not data, register named init functions and run them in order at boot; the first that errors stops the sequence.
logging
Request/response logging middleware.
params
Strong parameters: a Rails-style allowlist over untyped request params.
rate_limit
Fixed-window rate limiting (Rails 8 rate_limit to:, within:), backed by any doido_cache::CacheStore.
rescue
rescue_from: map specific error types to responses instead of a blanket 500 (Rails rescue_from RecordNotFound, with: :not_found).
respond
Format-based content negotiation (Rails respond_to).
response
route_table
Process-global table of the application’s routes.
secret
The process-global secret key base used to sign/encrypt cookies (session, flash, signed cookie jar).
server
Convenience entry point for booting an application’s HTTP server.
session
signing
Shared HMAC-SHA256 signing helpers used by the cookie jar (and available to any value that needs tamper-evident transport). Signatures are base64url, no-pad, and verified in constant time.
stack
testing
Integration/system test helpers: drive a Router in-process and inspect the response (Rails integration/system tests). Pair with doido_model factories and TestDb for full-stack tests.

Macros§

routes
Expands the routes! DSL (verbs, resources!, namespace!, scope!) into an axum::Router. Merged in from the former doido-router crate.

Structs§

LoggerConfig
Re-exported so config::LoggerConfig resolves; the logger config lives in doido-core alongside the logger it drives. Logging settings, deserialized from the logger section of config/<env>.yml.

Attribute Macros§

controller
Marks an impl block as a controller. Rewrites action methods into axum-compatible handlers, wiring in any filters.