lib

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorHandler = func(err error, c echo.Context) {
	if reflect.TypeOf(err) == reflect.TypeOf(&echo.HTTPError{}) {
		httpError := err.(*echo.HTTPError)
		c.JSON(httpError.Code, httpError.Message)
	} else if reflect.TypeOf(err) == reflect.TypeOf(&ErrorMessage{}) {
		errorMessage := err.(*ErrorMessage)
		c.JSON(http.StatusInternalServerError, errorMessage)
	} else {
		c.JSON(http.StatusInternalServerError, &ErrorMessage{"unknown_error", err.Error()})
	}
}
View Source
var Logger = newLogger()

Logger public Logger

View Source
var LoggerMiddleware = middleware.LoggerWithConfig(middleware.LoggerConfig{
	Format: "[REQ] ${time_rfc3339_nano} ${method} (HTTP${status}) ${uri} ${latency}ns\n",
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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