Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultMaxRequestBytes and DefaultMaxResponseBytes bound // captured payloads while preserving total byte counts. DefaultMaxRequestBytes int64 = 1 << 20 DefaultMaxResponseBytes int64 = 1 << 20 )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(configs ...Config) zinc.Middleware
New captures request and response bodies for Config.Observe without changing the bytes downstream handlers read or write. The request body is copied as handlers read it, up to MaxRequestBytes, so a body nothing reads isn't captured and capture never reads more than the handler does. An error a handler returns is rendered while capture is active, so the snapshot holds the response the client got. Configure Redact before exporting snapshots.
Types ¶
type Config ¶
type Config struct {
Observe Observer
Redact Redactor
MaxRequestBytes int64
MaxResponseBytes int64
}
Config controls capture limits, redaction, and observation.
Click to show internal directories.
Click to hide internal directories.