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

Source Files

Directories

Path Synopsis
available
validate