echoextention

package
v0.0.0-...-2b9378c Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const UNKNOWN_STATUS_CODE = 500

Variables

View Source
var DefaultConfig = GateLoggerConfig{
	IncludeRequestBodies:  false,
	IncludeResponseBodies: false,
	Skipper:               middleware.DefaultSkipper,
}
View Source
var DefaultRecoverConfig = RecoverConfig{
	Skipper:           middleware.DefaultSkipper,
	StackSize:         4 << 10,
	DisableStackAll:   false,
	DisablePrintStack: false,
	LogLevel:          echoLog.INFO,
	// contains filtered or unexported fields
}
View Source
var UndefinedError = errors.DefineError("Middleware", 14, "UndefinedError: %s")

Functions

func HookGateLogger

func HookGateLogger() echo.MiddlewareFunc

func HookGateLoggerWithConfig

func HookGateLoggerWithConfig(config GateLoggerConfig) echo.MiddlewareFunc

func Myskipper

func Myskipper(context echo.Context) bool

func Recover

func Recover() echo.MiddlewareFunc

func RecoverWithConfig

func RecoverWithConfig(config RecoverConfig) echo.MiddlewareFunc

func RegisterGlobalMiddlewares

func RegisterGlobalMiddlewares(e *echo.Echo, f GetStatusCodeFunc)

func Shutdown

func Shutdown(instance *echo.Echo, timeout time.Duration)

Shutdown shuts down the given HTTP server gracefully when receiving an os.Interrupt or syscall.SIGTERM signal. It will wait for the specified timeout to stop hanging HTTP handlers.

Types

type GateLoggerConfig

type GateLoggerConfig struct {
	IncludeRequestBodies  bool
	IncludeResponseBodies bool
	Skipper               Skipper
}

type GetStatusCodeFunc

type GetStatusCodeFunc func() errors.StatusCodeList

type RecoverConfig

type RecoverConfig struct {
	Skipper           Skipper
	StackSize         int  `yaml:"stack_size"`
	DisableStackAll   bool `yaml:"disable_stack_all"`
	DisablePrintStack bool `yaml:"disable_print_stack"`
	LogLevel          echoLog.Lvl
	// contains filtered or unexported fields
}

type Response

type Response struct {
	//Code    int    `json:"code"`
	Message string `json:"errorDescription"`
}

type Skipper

type Skipper func(echo.Context) bool

Directories

Path Synopsis
Package health check provides to add echo instance.
Package health check provides to add echo instance.

Jump to

Keyboard shortcuts

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