Documentation
¶
Overview ¶
Package routing provides dynamic routing capabilities for the Hapax server. It implements versioned API routing, health checks, and dynamic middleware configuration through YAML configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router handles dynamic HTTP routing with versioning and health checks. It provides: - Version-based routing (v1, v2, etc.) - Dynamic middleware configuration - Health check monitoring - Header validation - Method restrictions
func NewRouter ¶
NewRouter creates a new router with the given configuration. It initializes the router with global middleware and configures all routes based on the provided configuration.
Parameters:
- cfg: Server configuration containing route definitions
- handlers: Map of handler names to their implementations
- logger: Logger instance for error and debug logging
Returns:
- *Router: Configured router instance
Click to show internal directories.
Click to hide internal directories.