req

package
v0.0.0-...-5a53ebd Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const InKey = "input"

Variables

This section is empty.

Functions

func DecodeJSONBody

func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) error

func HasFormData

func HasFormData(r *http.Request) bool

func In

func In(ctx Ctx, inputStruct any, opts ...core.Option) error

func ParseInput

func ParseInput(ctx Ctx, inputStruct any, opts ...core.Option) error

func WantsHTML

func WantsHTML(r *http.Request) bool

func WantsJSON

func WantsJSON(r *http.Request) bool

Types

type Ctx

type Ctx interface {
	Request() *http.Request
	ResponseWriter() http.ResponseWriter
	Set(key string, value interface{})
	Get(key string) interface{}
}

type MalformedRequest

type MalformedRequest struct {
	Status  int
	Message string
}

func (*MalformedRequest) Error

func (mr *MalformedRequest) Error() string

type Validator

type Validator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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