mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-19 19:59:13 +03:00
20 lines
351 B
Go
20 lines
351 B
Go
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)
|
|
}
|