Initial commit

This commit is contained in:
Khanh Ngo 2020-04-18 16:17:49 +07:00
commit 6cb8527c35
12 changed files with 741 additions and 0 deletions

20
router/validator.go Normal file
View file

@ -0,0 +1,20 @@
package router
import "gopkg.in/go-playground/validator.v9"
// NewValidator func
func NewValidator() *Validator {
return &Validator{
validator: validator.New(),
}
}
// Validator struct
type Validator struct {
validator *validator.Validate
}
// Validate func
func (v *Validator) Validate(i interface{}) error {
return v.validator.Struct(i)
}