validator

package
v0.0.0-...-949c8fb Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("validator",
	fx.Provide(NewValidator),
)

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Error       bool
	FailedField string
	Tag         string
	Value       interface{}
}

type Validator

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

func NewValidator

func NewValidator() *Validator

func (*Validator) Format

func (v *Validator) Format(errs []ErrorResponse) []string

func (*Validator) MustValidate

func (v *Validator) MustValidate(data interface{}) error

func (*Validator) ParseBodyAndValidate

func (v *Validator) ParseBodyAndValidate(ctx *fiber.Ctx, out interface{}) error

func (*Validator) Validate

func (v *Validator) Validate(data interface{}) []ErrorResponse

Jump to

Keyboard shortcuts

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