The Request Lifecycle
When a request arrives at your Mizu application, it flows through these components:| Component | Description |
|---|---|
| App | Owns the HTTP server, manages startup and shutdown |
| Middleware | Pre/post-processing for requests (logging, auth, etc.) |
| Router | Matches URL patterns to handlers |
| Handler | Your code that processes requests |
| Context (Ctx) | Wraps request/response with helpers |
Core Components
App
Server lifecycle, configuration, and health checks.
Routing
URL patterns, path parameters, and route groups.
Handler
Functions that process requests and return responses.
Context
Request/response wrapper with helper methods.
Data Flow
Request
Reading path params, query strings, headers, and body.
Response
Sending JSON, HTML, files, and streaming data.
Cross-Cutting Concerns
Middleware
Composable request processing pipelines.
Error Handling
Centralized error handling and panic recovery.
Logging
Structured logging with Goβs slog package.
Static Files
Serving images, CSS, JavaScript, and embedded files.