validator

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilValidator = errors.New("validator is nil")
)

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware struct is the validation middleware

func NewMiddleware

NewMiddleware creates a new Middleware instance

func (*Middleware) Validate

func (m *Middleware) Validate(
	body interface{},
	auxiliaryValidatorFns ...interface{},
) func(next http.Handler) http.Handler

Validate validates the request body and stores it in the context

type Validator

type Validator interface {
	Validate(
		body,
		auxiliaryValidatorFn interface{},
	) func(next http.Handler) http.Handler
}

Validator interface

Jump to

Keyboard shortcuts

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