validate

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct {
	Debug bool
}

func (*Extractor) ExtractRequestValidation

func (e *Extractor) ExtractRequestValidation(ctx context.Context, req *http.Request, base routers.Route) RequestValidation

func (*Extractor) ExtractResponseValidation

func (e *Extractor) ExtractResponseValidation(ctx context.Context, validation *RequestValidation, res *http.Response) ResponseValidation

type Middleware

type Middleware struct {
	BaseRoute *routers.Route
	Next      http.Handler
	Extractor *Extractor
}

func (*Middleware) ServeHTTP

func (v *Middleware) ServeHTTP(w http.ResponseWriter, req *http.Request)

type MiddlewareBuilder

type MiddlewareBuilder struct {
	Doc       *openapi3.T
	Extractor *Extractor
}

func NewBuilder

func NewBuilder(doc *openapi3.T, debug bool) *MiddlewareBuilder

func (*MiddlewareBuilder) BuildMiddleware

func (b *MiddlewareBuilder) BuildMiddleware(pattern string, op *openapi3.Operation) func(http.Handler) http.Handler

type RequestValidation

type RequestValidation struct {
	Route *routers.Route
	Input *openapi3filter.RequestValidationInput
	Error error
}

type ResponseValidation

type ResponseValidation struct {
	Route *routers.Route
	Input *openapi3filter.ResponseValidationInput
	Error error
}

Jump to

Keyboard shortcuts

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