Versions in this module Expand all Collapse all v1 v1.2.0 Aug 6, 2024 v1.1.0 Jul 27, 2024 Changes in this version + var ContainsDigit = RuleSet + var ContainsSpecial = RuleSet + var ContainsUpper = RuleSet + var Email = RuleSet + var Required = RuleSet + var Time = RuleSet + var URL = RuleSet + var Username = RuleSet + type Errors map[string][]string + func Request(r *http.Request, data any, schema Schema) (Errors, bool) + func Validate(data any, fields Schema) (Errors, bool) + func (e Errors) Add(field string, msg string) + func (e Errors) Any() bool + func (e Errors) Get(field string) []string + func (e Errors) Has(field string) bool + type Numeric interface + type RuleSet struct + ErrorMessage string + FieldName any + FieldValue any + MessageFunc func(RuleSet) string + Name string + RuleValue any + ValidateFunc func(RuleSet) bool + func EQ[T comparable](v T) RuleSet + func GTE[T Numeric](n T) RuleSet + func GT[T Numeric](n T) RuleSet + func In[T any](values []T) RuleSet + func LTE[T Numeric](n T) RuleSet + func LT[T Numeric](n T) RuleSet + func Max(n int) RuleSet + func Min(n int) RuleSet + func Rules(rules ...RuleSet) []RuleSet + func TimeAfter(t time.Time) RuleSet + func TimeBefore(t time.Time) RuleSet + func (set RuleSet) Message(msg string) RuleSet + type Schema map[string][]RuleSet + func Merge(schema, other Schema) Schema