validator

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Phone = iota
	Mail
	Unknown
)

Variables

View Source
var (
	DefaultValidate *validator.Validate
)

Functions

func FieldError

func FieldError(fieldName string, err error) error

FieldError wraps a given Validator error providing a message call stack.

func IsPhone

func IsPhone(input string) bool

func PhoneOrMail

func PhoneOrMail(input string) int

func TransError

func TransError(err error, locale string) string

func ValidateStruct

func ValidateStruct(o any) error

Types

type Validator

type Validator interface {
	Validate() error
}

Validator is a general interface that allows a message to be validated.

type ValidatorAll

type ValidatorAll interface {
	Validate(all bool) error
}

Jump to

Keyboard shortcuts

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