Restructure project
This commit is contained in:
parent
e44e7caa11
commit
16b2f17301
46 changed files with 1744 additions and 1265 deletions
17
internal/router/validate.go
Normal file
17
internal/router/validate.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package router
|
||||
|
||||
import (
|
||||
"github.com/go-playground/validator/v10"
|
||||
)
|
||||
|
||||
type CustomValidator struct {
|
||||
Validator *validator.Validate
|
||||
}
|
||||
|
||||
func (cv *CustomValidator) Validate(i interface{}) error {
|
||||
return cv.Validator.Struct(i)
|
||||
}
|
||||
|
||||
func newValidator() *validator.Validate {
|
||||
return validator.New()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue