Documentation ¶
Index ¶
- Constants
- Variables
- func AccessLog(skipper middleware.Skipper) echo.MiddlewareFunc
- func HandlerFuncWrapper(fn HandlerFunc) echo.HandlerFunc
- func PrometheusMetrics(service string) func(echo.HandlerFunc) echo.HandlerFunc
- func WrapContextWithUser() func(echo.HandlerFunc) echo.HandlerFunc
- type APICode
- type HandlerFunc
Constants ¶
View Source
const HeaderUserID = "X-User-Id"
Variables ¶
View Source
var ( FilterPasswordFunc = func(s []byte) []byte { return passwordReg.ReplaceAll(s, []byte(`$1"*******"`)) } BodyDumpMiddleware = func(filterRequestFuncs ...func([]byte) []byte) echo.MiddlewareFunc { return middleware.BodyDumpWithConfig(middleware.BodyDumpConfig{ Handler: func(c echo.Context, reqData []byte, respData []byte) { for _, f := range filterRequestFuncs { reqData = f(reqData) } log.InfoWithContext(c.Request().Context(), "body_access_log", "path", c.Request().URL, "req", string(reqData), "resp", string(respData)) }, Skipper: middleware.DefaultSkipper}) } )
Functions ¶
func AccessLog ¶
func AccessLog(skipper middleware.Skipper) echo.MiddlewareFunc
func HandlerFuncWrapper ¶
func HandlerFuncWrapper(fn HandlerFunc) echo.HandlerFunc
func PrometheusMetrics ¶
func PrometheusMetrics(service string) func(echo.HandlerFunc) echo.HandlerFunc
PrometheusMetrics returns a prometheus metrics middlewaretools
func WrapContextWithUser ¶
func WrapContextWithUser() func(echo.HandlerFunc) echo.HandlerFunc
Types ¶
type HandlerFunc ¶
Click to show internal directories.
Click to hide internal directories.