httprequest

package
v1.6.33 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 18 Imported by: 7

Documentation

Index

Constants

View Source
const (
	FormDataMaxMemory = 256 << 20 // 256 MB
)

Variables

This section is empty.

Functions

func Indent

func Indent(r *http.Request) int

func NewPathItem added in v1.6.19

func NewPathItem(summary, description string, tags ...string) *pathitem

NewPathItem creates a new path item with the given summary, description and tags.

func Query

func Query(q url.Values, v any) error

Read the request query parameters into a structure

func Read

func Read(r *http.Request, v interface{}) error

Read the request body into a structure

Types

type PathItem added in v1.6.19

type PathItem interface {
	// Handler returns the http.HandlerFunc that handles the PathItem
	Handler() http.HandlerFunc

	// Spec returns the openapi.PathItem for a path with optional path parameters
	Spec(string, *jsonschema.Schema) *openapi.PathItem

	// WrapHandler wraps the handler for a specific HTTP method with middleware.
	// The method should be an uppercase HTTP method name (GET, POST, etc.).
	// If no handler is registered for the method, the call is a no-op.
	WrapHandler(method string, fn func(http.HandlerFunc) http.HandlerFunc)
}

Jump to

Keyboard shortcuts

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