Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IsEmail ¶
type IsEmail struct{}
IsEmail checks if the value is present or not
func (*IsEmail) ErrorMessage ¶
ErrorMessage returns a message indicating why the value is NOT valid
type Required ¶
type Required struct{}
Required checks if the value is present or not
func (*Required) ErrorMessage ¶
ErrorMessage returns a message indicating why the value is NOT valid
type Rule ¶
type Rule interface { // Type defines the type of the rule. // It should be unique within the entire set of rules Type() *RuleType // Config returns a map with all custom configuration data for the rule Config() map[string]interface{} // IsValid checks whether the value is valid or not according to the rule. // Default value returned should be false. This means that logic should // check if the value is valid IsValid(value interface{}) bool // ErrorMessage returns a message indicating why the value is NOT valid ErrorMessage(fieldName string) string }
Rule defines a validation to check if a value is valid or not
type RuleType ¶
type RuleType struct {
// contains filtered or unexported fields
}
RuleType defines the name of the rule. It should be unique within the entire set of rules
func NewRuleType ¶
NewRuleType creates an instance of RuleType
Click to show internal directories.
Click to hide internal directories.