Documentation ¶
Index ¶
- Variables
- func BindAndValidate(c echo.Context, i interface{}) error
- func BuildRequestLoggerConfig(logger *zap.Logger) middleware.RequestLoggerConfig
- func HashPassword(password string) ([]byte, error)
- func NewBadRequestError(code int, message string) *echo.HTTPError
- func NewDevelopment() *zap.Logger
- func NewProduction(debug bool) *zap.Logger
- type AppEnv
- type BadRequestError
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyPassword is returned when the password is empty ErrEmptyPassword = errors.New("password is empty") )
View Source
var (
// RFC3339Milli is a time.RFC3339 with millisecond precision
RFC3339Milli = "2006-01-02T15:04:05.999Z07:00"
)
Functions ¶
func BindAndValidate ¶
func BindAndValidate(c echo.Context, i interface{}) error
BindAndValidate binds and validates the input
func BuildRequestLoggerConfig ¶
func BuildRequestLoggerConfig(logger *zap.Logger) middleware.RequestLoggerConfig
BuildRequestLoggerConfig returns a new middleware.RequestLoggerConfig
func HashPassword ¶
HashPassword hashes the password
func NewBadRequestError ¶
NewBadRequestError returns a new BadRequestError
func NewDevelopment ¶
NewDevelopment returns a new development logger
func NewProduction ¶
NewProduction returns a new production loggers If debug is true, the logger will be set to debug level
Types ¶
type AppEnv ¶
type AppEnv string
AppEnv is the application environment
func (AppEnv) IsDevelopment ¶
IsDevelopment returns true if the environment is development
func (AppEnv) IsProduction ¶
IsProduction returns true if the environment is production
type BadRequestError ¶
BadRequestError is a custom error type for bad request
func (*BadRequestError) Error ¶
func (e *BadRequestError) Error() string
Error returns the error message
Click to show internal directories.
Click to hide internal directories.