Documentation ¶
Index ¶
- func NewValidator[T interface{}](fields map[string]*RuleList) *validator[T]
- type RuleList
- func (l *RuleList) Add(rule ValidationRule) *RuleList
- func (l *RuleList) Email() *RuleList
- func (l *RuleList) Execute(key, value string) (string, []string)
- func (l *RuleList) MaxLength(maxLenght int) *RuleList
- func (l *RuleList) MaxValue(maxValue float64) *RuleList
- func (l *RuleList) MinLength(minLenght int) *RuleList
- func (l *RuleList) MinValue(minValue float64) *RuleList
- func (l *RuleList) Number() *RuleList
- func (l *RuleList) Required() *RuleList
- func (l *RuleList) Trim() *RuleList
- type ValidationRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewValidator ¶
Types ¶
type RuleList ¶
type RuleList struct {
Rules []ValidationRule
}
func (*RuleList) Add ¶
func (l *RuleList) Add(rule ValidationRule) *RuleList
type ValidationRule ¶
Click to show internal directories.
Click to hide internal directories.