Documentation ¶
Index ¶
- Constants
- func AddRequestId(next echo.HandlerFunc) echo.HandlerFunc
- func CreateMetricsMiddleware(metrics *instrumentation.Metrics) echo.MiddlewareFunc
- func EnforceJSONContentType(next echo.HandlerFunc) echo.HandlerFunc
- func EnforceOrgId(next echo.HandlerFunc) echo.HandlerFunc
- func ExtractStatus(next echo.HandlerFunc) echo.HandlerFunc
- func MatchedRoute(ctx echo.Context) string
- func MetricsMiddlewareWithConfig(config *MetricsConfig) echo.MiddlewareFunc
- func NewRbac(config Rbac) echo.MiddlewareFunc
- func SkipAuth(c echo.Context) bool
- func WrapMiddlewareWithSkipper(m func(http.Handler) http.Handler, skip echo_middleware.Skipper) echo.MiddlewareFunc
- type MetricsConfig
- type Rbac
Constants ¶
View Source
const JSONMimeType = "application/json"
Variables ¶
This section is empty.
Functions ¶
func AddRequestId ¶
func AddRequestId(next echo.HandlerFunc) echo.HandlerFunc
Adds the request Id to the general context for use by pulp_client, candlepin_client, and general passing to Doa Layer Note that Lecho already adds it to the logger via the lecho middleware
func CreateMetricsMiddleware ¶
func CreateMetricsMiddleware(metrics *instrumentation.Metrics) echo.MiddlewareFunc
func EnforceJSONContentType ¶
func EnforceJSONContentType(next echo.HandlerFunc) echo.HandlerFunc
func EnforceOrgId ¶
func EnforceOrgId(next echo.HandlerFunc) echo.HandlerFunc
func ExtractStatus ¶
func ExtractStatus(next echo.HandlerFunc) echo.HandlerFunc
ExtractStatus is a middlware that sets the response status
based on the error returned. This is meant to be used with our own fork of lecho to figure out the proper logging level based on the Error contained within.
func MatchedRoute ¶
func MatchedRoute(ctx echo.Context) string
See: https://github.com/labstack/echo/pull/1502/files This method exist for v5 echo framework
func MetricsMiddlewareWithConfig ¶
func MetricsMiddlewareWithConfig(config *MetricsConfig) echo.MiddlewareFunc
func WrapMiddlewareWithSkipper ¶
func WrapMiddlewareWithSkipper(m func(http.Handler) http.Handler, skip echo_middleware.Skipper) echo.MiddlewareFunc
WrapMiddleware wraps `func(http.Handler) http.Handler` into `echo.MiddlewareFunc`
Types ¶
type MetricsConfig ¶
type MetricsConfig struct { Skipper echo_middleware.Skipper Metrics *instrumentation.Metrics }
type Rbac ¶
type Rbac struct { BaseUrl string Skipper echo_middleware.Skipper Client rbac.ClientWrapper PermissionsMap *rbac.PermissionsMap }
Click to show internal directories.
Click to hide internal directories.