Documentation ¶
Index ¶
Constants ¶
View Source
const ( REQUIRED = "required" TYPE = "type" LENGTH = "length" MIN_LENGTH = "minlength" MAX_LENGTH = "maxlength" EMAIL_VALIDATION = "email" DATE_VALIDATION = "date" ARRAY_LEN = "slice:len" ARRAY_MIN_LEN = "slice:minlen" ARRAY_MAX_LEN = "slice:maxlen" )
Variables ¶
This section is empty.
Functions ¶
func GetType ¶
func GetType[T comparable]() string
Types ¶
type FieldError ¶
func NewErrorByField ¶
func NewErrorByField(ruleType, fieldName, argument string) FieldError
type Rule ¶
type Rule interface { Type() string Description() string Validator() validatorFunc Argument() string IsValid(value interface{}) bool GenerateError(fieldName string) FieldError IsSliceRule() bool }
func GetRuleByHint ¶
func GetTypeValidator ¶
func NewRequiredRule ¶
func NewSliceRule ¶
func NewSliceRule[T comparable]() Rule
func NewTypeRule ¶
func NewTypeRule[T comparable]() Rule
func NewTypeRuleWithMethod ¶
func NewTypeRuleWithMethod(method validatorFunc) Rule
Click to show internal directories.
Click to hide internal directories.