validator

package
v0.0.0-...-2d549ef Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(structDateFormat string) error

Types

type ErrorFields

type ErrorFields map[string]string

type TimeValidator

type TimeValidator struct {
	Field    string
	RawValue string
	Layout   string
	// contains filtered or unexported fields
}

func NewTimeValidator

func NewTimeValidator(field, value, layout string) *TimeValidator

func (*TimeValidator) Validate

func (v *TimeValidator) Validate() error

func (*TimeValidator) Value

func (v *TimeValidator) Value() time.Time

type ValidationError

type ValidationError struct {
	Fields ErrorFields
}

func (ValidationError) Error

func (e ValidationError) Error() string

type Validator

type Validator interface {
	Validate() error
}

func ChainValidator

func ChainValidator(validators ...Validator) Validator

func StructValidator

func StructValidator(s interface{}) Validator

func UUIDValidator

func UUIDValidator(field, value string) Validator

Jump to

Keyboard shortcuts

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