Versions in this module Expand all Collapse all v1 v1.0.0 Apr 27, 2026 Changes in this version + const DefaultEvictionStrategy + const DefaultMaxCacheEntries + const DefaultSweepInterval + const MaxCacheBodySize + var ErrInvalidController = errors.New("web: invalid controller") + var ErrInvalidDirective = errors.New("web: invalid directive") + var ErrInvalidErrorHandler = errors.New("web: invalid error handler") + var ErrInvalidRequest = errors.New("web: invalid request") + var ErrInvalidRoute = errors.New("web: invalid route") + var ErrUnsupportedHandler = errors.New("web: unsupported handler") + func ApplyGlobalGuard(server HTTPServer, guard Guard) error + func Forbidden(message string) error + func GlobalErrorHandlerRegistry() *internal.ErrorHandlerRegistry + func GlobalRouteRegistry() *internal.RouteRegistry + func RegisterController(server HTTPServer, controller any) error + func RegisterErrorHandler(server HTTPServer, handler any) error + func RegisterGuard(server HTTPServer, name string, guard Guard) error + func RegisterGuardFactory(server HTTPServer, name string, factory GuardFactory) error + func RegisterInterceptor(server HTTPServer, name string, interceptor Interceptor) error + func RegisterInterceptorFactory(server HTTPServer, name string, factory InterceptorFactory) error + func Unauthorized(message string) error + type Context interface + Body func() []byte + Context func() context.Context + Header func(key string) string + IP func() string + JSON func(body any) error + Locals func(key string, value ...any) any + Method func() string + OriginalURL func() string + Param func(key string) string + Path func() string + Query func(key string) string + Send func(body []byte) error + SetHeader func(key, value string) + Status func(code int) + type ErrorDetail struct + Code string + Field string + Message string + Type string + type ErrorResponse struct + Error ErrorDetail + type FieldError struct + Field string + Msg string + type Guard interface + CanActivate func(Context) error + type GuardFactory func(argument string) (Guard, error) + type GuardFunc func(Context) error + func (f GuardFunc) CanActivate(ctx Context) error + type HTTPController interface + type HTTPServer interface + IsGeneratedOnly func() bool + RegisterRoute func(method, path string, handler HandlerFunc) error + ServeHTTP func(req *http.Request) (*http.Response, error) + Start func(addr string) error + Stop func(ctx context.Context) error + func NewServer(opts ...Option) HTTPServer + type HandlerFunc func(Context) error + type Interceptor interface + Intercept func(Context, HandlerFunc) error + type InterceptorFactory func(argument string) (Interceptor, error) + type InterceptorFunc func(Context, HandlerFunc) error + func (f InterceptorFunc) Intercept(ctx Context, next HandlerFunc) error + type Option func(*serverOptions) + func WithGeneratedOnly() Option + func WithRouteObserver(observer RouteObserver) Option + func WithTracerProvider(tp trace.TracerProvider) Option + type RequestError struct + func (e *RequestError) Error() string + func (e *RequestError) ErrorCode() string + func (e *RequestError) ErrorField() string + func (e *RequestError) ErrorType() string + func (e *RequestError) ResponseBody() any + func (e *RequestError) StatusCode() int + func (e *RequestError) Unwrap() error + type RouteObservation struct + Duration time.Duration + Method string + Route string + StatusCode int + type RouteObserver interface + Observe func(RouteObservation) + type ValidationErrorResponse struct + Errors []FieldError