Documentation ¶
Index ¶
- Variables
- func AddTagParsers(parser tagParser)
- func CheckErrors(opts ValidateParams) (ok bool, err error)
- func NewBinder(v Validator) echo.Binder
- func NewEngine(params EngineParams) *echo.Echo
- func NewLogger(log *zap.Logger) echo.Logger
- func NewMultiServer(params MultiServerParams) mserv.Server
- type APIParams
- type CustomError
- type EmptyWriter
- type EngineParams
- type FieldError
- type FieldLevel
- type Func
- type MultiServerParams
- type ServerResult
- type ValidateParams
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var Null = new(EmptyWriter)
Null is /dev/null emulation
View Source
var ( // ServersModule of web base structs ServersModule = module.Module{ {Constructor: NewAPIServer}, {Constructor: NewMetricsServer}, {Constructor: NewPprofServer}, {Constructor: NewMultiServer}, } )
Functions ¶
func AddTagParsers ¶ added in v0.5.0
func AddTagParsers(parser tagParser)
AddTagParsers used in fieldName
func CheckErrors ¶ added in v0.5.0
func CheckErrors(opts ValidateParams) (ok bool, err error)
CheckErrors of validator and return formatted errors:
func NewEngine ¶
func NewEngine(params EngineParams) *echo.Echo
func NewMultiServer ¶ added in v0.5.0
func NewMultiServer(params MultiServerParams) mserv.Server
NewMultiServer returns new multi servers group
Types ¶
type CustomError ¶ added in v0.4.1
type EngineParams ¶ added in v0.5.0
type FieldError ¶ added in v0.5.0
FieldError contains field name and validator error
func (FieldError) Error ¶ added in v0.5.0
func (f FieldError) Error() string
type FieldLevel ¶ added in v0.5.0
type FieldLevel = validator.FieldLevel
type MultiServerParams ¶ added in v0.5.0
type ServerResult ¶ added in v0.5.0
func NewAPIServer ¶ added in v0.5.0
NewAPIServerParams params for create api server by http.Handler from DI container
func NewMetricsServer ¶ added in v0.5.0
func NewMetricsServer(v *viper.Viper, l logger.StdLogger) ServerResult
NewMetricsServer returns wrapped prometheus http server
func NewPprofServer ¶ added in v0.5.0
func NewPprofServer(v *viper.Viper, l logger.StdLogger) ServerResult
NewPprofServer returns wrapped pprof http server
type ValidateParams ¶ added in v0.5.0
type ValidateParams struct { Struct interface{} Errors error Formatter func(fields []*FieldError) string }
ValidateParams to call CheckErrors method
Click to show internal directories.
Click to hide internal directories.