Documentation ¶
Index ¶
- func GetDBX(c echo.Context) (*sqlx.DB, error)
- func GetIDToken(c echo.Context) (*auth.Token, error)
- func GetLogger(c echo.Context) zerolog.Logger
- func LoggedUserIs(c echo.Context, rol string) bool
- func LoggedUserIsAny(c echo.Context, roles []string) bool
- func MustGetDBX(c echo.Context) *sqlx.DB
- func RequestID(c echo.Context) string
- type App
- type AppOptions
- type RouterOptions
- type Validator
- type ValidatorRawError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIDToken ¶ added in v0.0.10
GetIDToken is a shortcut to middleware.GetIDToken()
func LoggedUserIs ¶ added in v0.0.13
LoggedUserIs is a shortcut to middleware.LoggedUserIs()
func LoggedUserIsAny ¶ added in v0.0.13
LoggedUserIsAny is a shortcut to middleware.LoggedUserIsAny()
func MustGetDBX ¶ added in v0.0.14
MustGetDBX is like GetDBX but panics on error
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func New ¶
func New(options AppOptions) *App
NewApp generates a new app with tools expecified in provided options.
type RouterOptions ¶
type RouterOptions struct { Router *echo.Echo Validator echo.Validator }
RouterOptions model the echo router options. If provided, app will use the expecified echo router.
type Validator ¶ added in v0.0.17
type Validator struct {
// contains filtered or unexported fields
}
Validator is the default validator. It uses the go-playground validator and wraps the error in a echo.HTTPError with a status 400 error. For more control over the status code, please use the ValidatorRawError
func NewValidator ¶ added in v0.0.17
func NewValidator() *Validator
type ValidatorRawError ¶ added in v0.0.17
type ValidatorRawError struct {
// contains filtered or unexported fields
}
ValidatorRawError uses the go-playground validator and return the raw error directly. No handling this error will become in a InternalServerError (500) if validation fails and you return the error to echo.
func NewValidatorRawError ¶ added in v0.0.17
func NewValidatorRawError() *ValidatorRawError
func (*ValidatorRawError) Validate ¶ added in v0.0.17
func (v *ValidatorRawError) Validate(i interface{}) error