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
func (c CustomMessageValidationError) Error() string
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) Get ¶
func (b ErrorsBag) Get(field string) []ValidationError
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 ValueExporterTypeMismatchError ¶ added in v0.4.0
func (ValueExporterTypeMismatchError) Error ¶ added in v0.4.0
func (e ValueExporterTypeMismatchError) Error() string
Click to show internal directories.
Click to hide internal directories.