Skip to content

Commit 923196d

Browse files
docs: add doc.go with top-level package documentation
1 parent 5363380 commit 923196d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

0 commit comments

Comments
 (0)