Versions in this module Expand all Collapse all v0 v0.1.1 Apr 12, 2026 v0.1.0 Apr 11, 2026 Changes in this version + func Chain(h http.Handler, middlewares ...Middleware) http.Handler + func CorrelationIDFromContext(ctx context.Context) string + func Error(status int, message string, err error) error + func RequestIDFromContext(ctx context.Context) string + func SpanIDFromContext(ctx context.Context) string + func TraceIDFromContext(ctx context.Context) string + type CORSConfig struct + AllowCredentials bool + AllowedHeaders []string + AllowedMethods []string + AllowedOrigins []string + ExposedHeaders []string + MaxAge int + type EndpointOption func(*endpointConfig) + func WithAuthCheck(check func(*http.Request) bool) EndpointOption + func WithAuthGate(fn func(*http.Request) error) EndpointOption + func WithBodyLimit(n int64) EndpointOption + func WithEndpointMiddleware(mw ...Middleware) EndpointOption + func WithEndpointResponseEncoder(encoder ResponseEncoder) EndpointOption + func WithEndpointTimeout(timeout time.Duration) EndpointOption + func WithSkipAccessLog() EndpointOption + func WithSkipTelemetry() EndpointOption + type ErrorEncoder func(http.ResponseWriter, *http.Request, error) error + func JSONError() ErrorEncoder + type HTTPError struct + Err error + Message string + StatusCode int + func (e HTTPError) Error() string + func (e HTTPError) Unwrap() error + type HandlerFunc func(r *http.Request) (any, error) + type Middleware func(http.Handler) http.Handler + func AccessLog(logger *slog.Logger) Middleware + func CorrelationID() Middleware + func Recovery(logger *slog.Logger, propagate bool) Middleware + func RequestID() Middleware + func SkipAccessLog() Middleware + type Option func(*Server) + func WithAccessLogEnabled(enabled bool) Option + func WithAddr(addr string) Option + func WithBuildInfo(version, commit, date string) Option + func WithCORSConfig(cfg CORSConfig) Option + func WithCorrelationIDEnabled(enabled bool) Option + func WithDefaultEndpointsEnabled(enabled bool) Option + func WithErrorEncoder(encoder ErrorEncoder) Option + func WithHTTPServerErrorLog(logger *log.Logger) Option + func WithHTTPServerErrorLogLevel(level slog.Level) Option + func WithHealthHandler(handler http.Handler) Option + func WithIdleTimeout(timeout time.Duration) Option + func WithLogger(logger *slog.Logger) Option + func WithMaxHeaderBytes(n int) Option + func WithMeterProvider(mp metric.MeterProvider) Option + func WithMiddleware(mw ...Middleware) Option + func WithMux(mux *http.ServeMux) Option + func WithOTelAttributes(fn func(*http.Request) []attribute.KeyValue) Option + func WithOTelPanicMetricEnabled(enabled bool) Option + func WithOpenTelemetryEnabled(enabled bool) Option + func WithPanicPropagation(enabled bool) Option + func WithPropagator(p propagation.TextMapPropagator) Option + func WithReadHeaderTimeout(timeout time.Duration) Option + func WithReadTimeout(timeout time.Duration) Option + func WithReadinessChecks(checks ...ReadinessCheck) Option + func WithRecoveryEnabled(enabled bool) Option + func WithRequestBodyLimit(n int64) Option + func WithRequestIDEnabled(enabled bool) Option + func WithResponseEncoder(encoder ResponseEncoder) Option + func WithRouteLabeler(fn func(*http.Request) string) Option + func WithShutdownDrainDelay(delay time.Duration) Option + func WithShutdownTimeout(timeout time.Duration) Option + func WithSpanNameFormatter(fn func(*http.Request, string) string) Option + func WithTracerProvider(tp trace.TracerProvider) Option + func WithWriteTimeout(timeout time.Duration) Option + type ReadinessCheck func(context.Context) error + type ResponseEncoder func(http.ResponseWriter, *http.Request, any) error + func JSONResponse() ResponseEncoder + type Server struct + func New(opts ...Option) *Server + func (s *Server) Handle(method, path string, h HandlerFunc, opts ...EndpointOption) + func (s *Server) HandleHTTP(method, path string, h http.Handler, opts ...EndpointOption) + func (s *Server) Handler() http.Handler + func (s *Server) Ready() bool + func (s *Server) Run(ctx context.Context) error + func (s *Server) SetReady(ready bool)