Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORSOption ¶
type LoggingOption ¶
type LoggingOption struct {
ExcludedPrefixes []string
}
type Middleware ¶
Middleware is a function type that represents an HTTP middleware.
type MiddlewareOption ¶
type MiddlewareOption func(*middlewareOptions)
func WithCORS ¶
func WithCORS(allowedMethods, allowedOrigins []string) MiddlewareOption
WithCORS returns a MiddlewareOption that sets the CORS middleware options.
func WithLogging ¶
func WithLogging(prefixes []string) MiddlewareOption
WithLogging returns a MiddlewareOption that sets the Logging middleware options.
func WithTelemetry ¶
func WithTelemetry(excludedPrefixes []string) MiddlewareOption
WithTelemetry returns a MiddlewareOption that sets the Telemetry (Metrics & Traces) middleware options.
type Router ¶
Router is a custom HTTP router that supports middlewares.
func NewRouter ¶
func NewRouter(opts ...MiddlewareOption) *Router
NewRouter creates a new Router with the specified MiddlewareOptions. It sets up middlewares for CORS, logging, and tracing based on the provided options.
func (*Router) HandlerFunc ¶
func (r *Router) HandlerFunc() *http.HandlerFunc
HandlerFunc method returns a http.HandlerFunc that wraps the Router with the configured middlewares.
type TelemetryOption ¶
type TelemetryOption struct {
ExcludedPrefixes []string
}