validator

package
v0.0.0-...-8f56db8 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultError

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

func (*DefaultError) Error

func (e *DefaultError) Error() string

func (*DefaultError) Expected

func (e *DefaultError) Expected() string

func (*DefaultError) GetErrorID

func (e *DefaultError) GetErrorID() ErrorID

func (*DefaultError) GetFieldName

func (e *DefaultError) GetFieldName() string

func (*DefaultError) SetFieldName

func (e *DefaultError) SetFieldName(f string)

type Error

type Error interface {
	error
	GetErrorID() ErrorID
	SetFieldName(string)
	GetFieldName() string
	Expected() string
}

func NewDefaultError

func NewDefaultError(fieldName string, expected string) Error

type ErrorID

type ErrorID int
const (
	// Default Error
	ErrorDefault ErrorID = iota

	// Validate Error
	ErrorRequired
	ErrorOneOf
	ErrorEq
	ErrorNE
	ErrorGT
	ErrorGTE
	ErrorLT
	ErrorLTE
	ErrorURL
	ErrorNotEmpty
	ErrorHTTP
	ErrorRegex

	// Available Error
	ErrorSince
	ErrorUntil
)

ErrorID enum

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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