validator

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule interface {
	Tag() string
	ErrMsg() string
	CallIfNull() bool
	Validate(fl validator.FieldLevel) bool
}

type ValidateError

type ValidateError struct {
	Fields map[string]string
}

func NewValidateError

func NewValidateError() *ValidateError

func NewValidateErrorWithMessage

func NewValidateErrorWithMessage(key, message string) *ValidateError

func (*ValidateError) Error

func (e *ValidateError) Error() string

type Validator

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

func NewValidator

func NewValidator() *Validator

func (*Validator) AddRule

func (e *Validator) AddRule(rule Rule) error

func (*Validator) Validate

func (e *Validator) Validate(i interface{}) error

Jump to

Keyboard shortcuts

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