Documentation ¶
Index ¶
- Variables
- func AddTagParsers(parser tagParser)
- func CheckErrors(opts ValidateParams) (ok bool, err error)
- func LoggerMiddleware(log *zap.Logger) echo.MiddlewareFunc
- func NewBinder(v Validator) echo.Binder
- func NewEngine(params EngineParams) *echo.Echo
- func NewLogger(log *zap.Logger) echo.Logger
- type CustomError
- type EngineParams
- type FieldError
- type FieldLevel
- type Func
- type ValidateParams
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = module.Module{ {Constructor: NewValidator}, {Constructor: NewBinder}, {Constructor: NewEngine}, }
Module engine
Functions ¶
func CheckErrors ¶
func CheckErrors(opts ValidateParams) (ok bool, err error)
CheckErrors of validator and return formatted errors:
func LoggerMiddleware ¶ added in v0.4.0
LoggerMiddleware returns a middleware that logs HTTP requests.
func NewEngine ¶
func NewEngine(params EngineParams) *echo.Echo
NewEngine returns configured echo engine
Types ¶
type CustomError ¶
type CustomError interface {
FormatResponse(ctx echo.Context) error
}
CustomError interface
type EngineParams ¶
type EngineParams struct { dig.In Config *viper.Viper `optional:"true"` Binder echo.Binder `optional:"true"` Logger *zap.Logger `optional:"true"` EchoLogger echo.Logger `optional:"true"` Validator echo.Validator `optional:"true"` }
EngineParams struct
type FieldError ¶
FieldError contains field name and validator error
func (FieldError) Error ¶
func (f FieldError) Error() string
type FieldLevel ¶
type FieldLevel = validator.FieldLevel
FieldLevel contains all the information and helper functions to validate a field
type Func ¶
type Func = validator.Func
Func accepts a FieldLevel interface for all validation needs. The return value should be true when validation succeeds.
type ValidateParams ¶
type ValidateParams struct { Struct interface{} Errors error Formatter func(fields []*FieldError) string }
ValidateParams to call CheckErrors method
type Validator ¶
Validator to implement custom echo.Validator
func WrapValidator ¶
func WrapValidator(v *validator.Validate) Validator
WrapValidator wraps v9.validator
Click to show internal directories.
Click to hide internal directories.