Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConditionalMiddleware ¶
type ConditionalMiddleware struct {
Pattern string // The URL path pattern to match, e.g., "/api/v1/*"
Middleware Middleware // The middleware function to apply when the pattern matches
}
ConditionalMiddleware pairs a middleware with a path pattern. The middleware is only applied if the request path matches the pattern. Patterns can use a wildcard '*' at the end to match any subpath.
type Middleware ¶
type Middleware func(server.HandlerFunc) server.HandlerFunc
Middleware defines the function signature for all middleware in OneStrike. A middleware wraps a HandlerFunc, allowing pre- or post-processing of requests. Example: logging, authentication, profiling, or panic recovery.
func ProfilingMiddleware ¶
func ProfilingMiddleware() Middleware
ProfilingMiddleware logs detailed timing info including handler execution and memory usage
func Recovery ¶
func Recovery() Middleware
Panic Recovery Recovery returns a middleware that recovers from panics and writes a 500 response.
Click to show internal directories.
Click to hide internal directories.