validator

package
v0.0.0-...-8122643 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationError

type ValidationError struct {
	Message string `json:"message"`
	Field   string `json:"field"`
	Err     error  `json:"error"`
}

func ValidateMap

func ValidateMap(v Validator, m map[string]interface{}, sampleStruct interface{}, allowedFields ...string) *ValidationError

func (*ValidationError) Error

func (e *ValidationError) Error() string

func (*ValidationError) GenericError

func (e *ValidationError) GenericError() generic_error.Error

type Validator

type Validator interface {
	Validate(s interface{}) error
	ValidateValue(value interface{}, rules string) error
	ValidatePartial(s interface{}, fields ...string) *ValidationError
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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