Documentation ¶
Index ¶
- Variables
- func AccessLog() echo.MiddlewareFunc
- func AccessLogWithConfig(config LoggerConfig) echo.MiddlewareFunc
- func CircuitBreakWithConfig(config CircuitBreakConfig) echo.MiddlewareFunc
- func LoggerAdapter() echo.MiddlewareFunc
- func LoggerAdapterWithConfig(config LoggerAdapterConfig) echo.MiddlewareFunc
- type CircuitBreakConfig
- type LoggerAdapterConfig
- type LoggerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrJudgmentNotPassed = errors.New("judgement not passed")
)
Functions ¶
func AccessLog ¶
func AccessLog() echo.MiddlewareFunc
AccessLog returns the middleware_ext of AccessLog using the default logger generator
func AccessLogWithConfig ¶
func AccessLogWithConfig(config LoggerConfig) echo.MiddlewareFunc
AccessLogWithConfig returns the middleware_ext of AccessLog with a custom configuration
func CircuitBreakWithConfig ¶
func CircuitBreakWithConfig(config CircuitBreakConfig) echo.MiddlewareFunc
CircuitBreakWithConfig Returns the middleware_ext of the circuit break
func LoggerAdapter ¶
func LoggerAdapter() echo.MiddlewareFunc
LoggerAdapter use default config middleware_ext
func LoggerAdapterWithConfig ¶
func LoggerAdapterWithConfig(config LoggerAdapterConfig) echo.MiddlewareFunc
LoggerAdapterWithConfig use custom config middleware_ext
Types ¶
type CircuitBreakConfig ¶
type CircuitBreakConfig struct { //Judge whether the circuit breaker needs counting Judge func(ctx echo.Context) bool //CircuitBreaker at work CircuitBreaker *gobreaker.CircuitBreaker //Skipper defines a function to skip middleware_ext. Skipper middleware.Skipper //FailBack defines fault handle function when an error occurs FailBack func(ctx echo.Context, err error) error }
type LoggerAdapterConfig ¶
type LoggerAdapterConfig struct { //Generator Generate a log logger Generator func() log.Logger Skipper middleware.Skipper }
type LoggerConfig ¶
Click to show internal directories.
Click to hide internal directories.