middleware

package
v1.12.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultHealthPath = "/healthz"

Variables

This section is empty.

Functions

func NewCompress

func NewCompress() server.Middleware

Encoded lazily during Render through a pooled writer, so a response nobody renders costs nothing.

func NewErrorRenderer

func NewErrorRenderer(renderers ...Renderer) server.Middleware

NewErrorRenderer: first non-nil renderer wins. defaultRender always matches at the end — pass a catch-all last to replace the default.

func NewHealth

func NewHealth(path string) server.Middleware

NewHealth: empty path → DefaultHealthPath.

func NewLog

func NewLog(logger pry.Logger) server.Middleware

NewLog: place outside Error so Log sees the rendered status, not the raw err.

func NewMaxBody

func NewMaxBody(limit int64) server.Layer

Per-route rather than global: an upload endpoint and a JSON one want different caps.

func NewRecover

func NewRecover() server.Middleware

func NewSession

func NewSession() server.Middleware

func NewTracing

func NewTracing(provider hilton.Provider) server.Middleware

NewTracing: place after Session (mirrors our span's traceparent into Session so downstream calls inherit it, not the upstream caller's).

Types

type Renderer

type Renderer func(err error) server.Renderer

Renderer: nil return means "I don't handle this" — chain falls through.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL