validate

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check[T any](v *Validator, value T, validatorFunc ValidatorFunc[T], key string)

func IsNotEmpty

func IsNotEmpty(value string) (bool, string)

func IsValidTimeZone

func IsValidTimeZone(value string) (bool, string)

Types

type IValidatedType

type IValidatedType interface {
	Validate() *Validator
}

type Validator

type Validator struct {
	Errors map[string]string
}

func New

func New() *Validator

func (*Validator) AddError

func (v *Validator) AddError(key, message string)

func (*Validator) Valid

func (v *Validator) Valid() bool

type ValidatorFunc

type ValidatorFunc[T any] func(value T) (bool, string)

func IsGreaterThanFunc

func IsGreaterThanFunc[T shared.IntType](value1 T) ValidatorFunc[T]

func IsGreaterThanOrEqualFunc

func IsGreaterThanOrEqualFunc[T shared.IntType](value1 T) ValidatorFunc[T]

func IsLesserThanFunc

func IsLesserThanFunc[T shared.IntType](value1 T) ValidatorFunc[T]

func IsLesserThanOrEqualFunc

func IsLesserThanOrEqualFunc[T shared.IntType](value1 T) ValidatorFunc[T]

Jump to

Keyboard shortcuts

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