error

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuleAfter           = "AFTER"
	RuleAfterOrEqual    = "AFTER_OR_EQUAL"
	RuleArray           = "ARRAY"
	RuleArrayOf         = "ARRAY_OF"
	RuleBefore          = "BEFORE"
	RuleBeforeOrEqual   = "BEFORE_OR_EQUAL"
	RuleBetween         = "BETWEEN"
	RuleBoolean         = "BOOLEAN"
	RuleCustom          = "CUSTOM"
	RuleDateFormat      = "DATE_FORMAT"
	RuleDoesntEndWith   = "DOESNT_END_WITH"
	RuleDoesntStartWith = "DOESNT_START_WITH"
	RuleDuration        = "DURATION"
	RuleEmail           = "EMAIL"
	RuleEndsWith        = "ENDS_WITH"
	RuleFilled          = "FILLED"
	RuleFloat           = "FLOAT"
	RuleIn              = "IN"
	RuleInt             = "INT"
	RuleIP              = "IP"
	RuleLength          = "LENGTH"
	RuleMap             = "MAP"
	RuleMax             = "MAX"
	RuleMin             = "MIN"
	RuleNotIn           = "NOT_IN"
	RuleNotRegex        = "NOT_REGEX"
	RuleNumeric         = "NUMERIC"
	RuleRegex           = "REGEX"
	RuleRequired        = "REQUIRED"
	RuleSlice           = "SLICE"
	RuleSliceOf         = "SLICE_OF"
	RuleStartsWith      = "STARTS_WITH"
	RuleString          = "STRING"
	RuleStruct          = "STRUCT"
	RuleURL             = "URL"
	RuleUUID            = "UUID"
)
View Source
const (
	TypeArray   = "ARRAY"
	TypeInvalid = "INVALID"
	TypeMap     = "MAP"
	TypeNumber  = "NUMBER"
	TypeSlice   = "SLICE"
	TypeString  = "STRING"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicValidationError

type BasicValidationError struct {
	Rule string `json:"rule"`
}

func (BasicValidationError) GetRule

func (e BasicValidationError) GetRule() string

type CustomMessageValidationError added in v0.2.0

type CustomMessageValidationError struct {
	BasicValidationError

	Message string `json:"message"`
}

func NewCustomMessageValidationError added in v0.2.0

func NewCustomMessageValidationError(rule, message string) *CustomMessageValidationError

func (CustomMessageValidationError) Error added in v0.2.0

type ErrorsBag

type ErrorsBag map[string][]ValidationError

func NewErrorsBag

func NewErrorsBag() ErrorsBag

func (ErrorsBag) Add

func (b ErrorsBag) Add(field string, errors ...ValidationError)

func (ErrorsBag) All

func (b ErrorsBag) All() map[string][]ValidationError

func (ErrorsBag) Any

func (b ErrorsBag) Any() bool

func (ErrorsBag) Error

func (b ErrorsBag) Error() string

func (ErrorsBag) Get

func (b ErrorsBag) Get(field string) []ValidationError

func (ErrorsBag) Has added in v0.2.0

func (b ErrorsBag) Has(field string) bool

type NotListTypeError added in v0.4.0

type NotListTypeError struct {
}

func (NotListTypeError) Error added in v0.4.0

func (NotListTypeError) Error() string

type NotStructTypeError added in v0.4.0

type NotStructTypeError struct {
}

func (NotStructTypeError) Error added in v0.4.0

func (NotStructTypeError) Error() string

type ValidationError

type ValidationError interface {
	GetRule() string
	Error() string
}

type ValueExporterTypeMismatchError added in v0.4.0

type ValueExporterTypeMismatchError struct {
	ValueType  string
	TargetType string
}

func (ValueExporterTypeMismatchError) Error added in v0.4.0

Jump to

Keyboard shortcuts

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