validation

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// validation of an unsupported type
	ErrUnsupportedType = errors.New("unsupported type")
)

Functions

func IsValidEmail

func IsValidEmail(email string) bool

validates email using net/email pkg

Types

type Validator

type Validator interface {
	// Validate obj.
	//
	//If validation fails, it return validator.ValidationErrors
	Validate(obj any) error
	SetTagName(tagName string)
}

Interface for the validator. Validates structs, pointers to structs, Slices, arrays, pointers to slices & arrays.

Based on https://github.com/go-playground/validator/v10

func NewValidator

func NewValidator(tagName string) Validator

returns a new validator for tagName

Jump to

Keyboard shortcuts

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