Versions in this module Expand all Collapse all v0 v0.1.0 Aug 10, 2026 Changes in this version + const LevelDebug + const LevelError + const LevelInfo + const LevelTrace + const LevelWarn + func CSV(w http.ResponseWriter, status int, records [][]string) error + func Download(w http.ResponseWriter, status int, filename, contentType string, ...) error + func HTML(w http.ResponseWriter, status int, renderer Renderer) error + func JSON(w http.ResponseWriter, status int, value any) error + func ReadRequestID(ctx context.Context) (string, bool) + func Redirect(w http.ResponseWriter, r *http.Request, location string, status int) + func WriteError(w http.ResponseWriter, r *http.Request, err error) + func XML(w http.ResponseWriter, status int, value any) error + type App struct + func New(options ...Option) *App + func (a *App) Handle(pattern string, handler http.Handler) + func (a *App) HandleFunc(pattern string, handler http.HandlerFunc) + func (a *App) Handler() http.Handler + func (a *App) ListenAndServe(addr string) error + func (a *App) Middlewares() []Middleware + func (a *App) Mux() *httpmux.ServeMux + func (a *App) Run(ctx context.Context, addr string) error + func (a *App) Serve(server *http.Server) error + func (a *App) SetErrorRenderer(renderer ErrorRenderer) + func (a *App) Shutdown(ctx context.Context) error + func (a *App) String() string + func (a *App) Use(middleware ...Middleware) + func (a *App) Validate() error + func (a *App) WriteError(w http.ResponseWriter, r *http.Request, err error) + type Attribute = pwruntime.Attribute + func Bool(key string, value bool) Attribute + func Err(err error) Attribute + func Float64(key string, value float64) Attribute + func Int(key string, value int) Attribute + func Int64(key string, value int64) Attribute + func String(key, value string) Attribute + type ErrorHandler struct + Logger Logger + Renderer ErrorRenderer + func (h ErrorHandler) WriteError(w http.ResponseWriter, r *http.Request, err error) + type ErrorPage struct + Code string + Detail string + RequestID string + Status int + Title string + func (p ErrorPage) String() string + type ErrorRenderer func(http.ResponseWriter, *http.Request, ErrorPage) error + type HSTSConfig = middlewares.HSTSConfig + type Lifecycle = middlewares.Lifecycle + type Logger = pwruntime.Logger + func ReadLogger(ctx context.Context) Logger + type Middleware func(http.Handler) http.Handler + func LifecycleHeaders(lifecycle Lifecycle) (Middleware, error) + func MaxRequestBody(bytes int64) Middleware + func Recover(handler ErrorHandler) Middleware + func RequestID(header string, logger Logger) Middleware + func SecurityHeaders(config SecurityHeadersConfig) (Middleware, error) + type Option func(*App) error + func WithCloser(closer func(context.Context) error) Option + func WithErrorRenderer(renderer ErrorRenderer) Option + func WithMiddleware(middleware ...Middleware) Option + func WithOpenAPI(document []byte) Option + func WithReadinessCheck(check ReadyCheck) Option + func WithServerConfig(config ServerConfig) Option + type ReadyCheck func(context.Context) error + type RenderFunc func(io.Writer) error + func (f RenderFunc) Render(w io.Writer) error + type Renderer interface + Render func(io.Writer) error + type SecurityHeadersConfig = middlewares.SecurityHeadersConfig + func DefaultSecurityHeaders() SecurityHeadersConfig + type ServerConfig struct + Address string + Health string + IdleTimeout time.Duration + MaxRequestBody int64 + OpenAPI string + ReadHeaderTimeout time.Duration + ReadTimeout time.Duration + Readiness string + ShutdownTimeout time.Duration + TrustedProxies []string + WriteTimeout time.Duration + func DefaultServerConfig() ServerConfig + func (c ServerConfig) Validate() error