middlewares

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMiddleware

func InitMiddleware(e *echo.Echo, wrapper Wrapper)

func RequestLoggerMiddleware

func RequestLoggerMiddleware(wrapper Wrapper) echo.MiddlewareFunc

Types

type APIError

type APIError struct {
	Code    int
	Message string
}

type ErrorController

type ErrorController struct {
	// contains filtered or unexported fields
}

ErrorController is a controller for handling errors.

func NewErrorController

func NewErrorController(wrapper Wrapper) *ErrorController

NewErrorController is constructor.

func (*ErrorController) JSONError

func (controller *ErrorController) JSONError(err error, c echo.Context)

JSONError is cumstomize error handler

type Wrapper

type Wrapper interface {
	GetConfig() *config.EnvConfig
	GetLogger() *logger.Logger
}

Wrapper represents a interface for accessing the data which sharing in overall application.

func NewWrapper

func NewWrapper(config *config.EnvConfig, logger *logger.Logger) Wrapper

NewWrapper is constructor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL