File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ // Package validator provides a lightweight, expressive, and extensible validation library for Go,
2+ // inspired by Laravel's Validator. It allows developers to define validation rules using
3+ // declarative, chainable syntax on dynamic input data.
4+ //
5+ // This package supports a wide range of rules such as:
6+ //
7+ // - string, min, max
8+ // - email (basic, rfc, dns)
9+ // - numeric, int, float64
10+ // - gt, lt (greater/less than)
11+ // - boolean
12+ //
13+ // Example usage:
14+ //
15+ // data := map[string]any{
16+ // "email": "rick@astley.com",
17+ // "age": 21,
18+ // }
19+ //
20+ // rules := map[string][]string{
21+ // "email": {"email:rfc,dns"},
22+ // "age": {"numeric", "gt:18"},
23+ // }
24+ //
25+ // v := validator.Make(data, rules)
26+ // if !v.Validate() {
27+ // for field, errs := range v.Errors() {
28+ // for _, msg := range errs {
29+ // fmt.Println(field + ": " + msg)
30+ // }
31+ // }
32+ // }
33+ //
34+ // See README for full examples, available rules, and custom rule extension.
35+ package validator
You can’t perform that action at this time.
0 commit comments