requeststate

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package requeststate owns replayable request-body snapshots shared by validation stages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachRoute

func AttachRoute(request *http.Request, route *router.Route) func()

AttachRoute scopes a resolved route to a request and returns an idempotent restoration function.

func Install

func Install(request *http.Request, body []byte)

Install replaces a request body with an immutable replayable snapshot.

func Route

func Route(request *http.Request) *router.Route

Route returns the route scoped to the current high-level validation call.

func Snapshot

func Snapshot(request *http.Request) ([]byte, error)

Snapshot reads a request body once and installs replay support while leaving it readable.

func WithFreshBody

func WithFreshBody(request *http.Request, callback func() error) error

WithFreshBody gives a callback an independent reader and restores a fresh reader afterward.

Types

This section is empty.

Jump to

Keyboard shortcuts

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