Documentation
¶
Index ¶
- Constants
- func AddRequestId(next echo.HandlerFunc) echo.HandlerFunc
- func CreateMetricsMiddleware(metrics *instrumentation.Metrics) echo.MiddlewareFunc
- func EnforceConsistentOrgId(next echo.HandlerFunc) echo.HandlerFunc
- func EnforceJSONContentType(next echo.HandlerFunc) echo.HandlerFunc
- func EnforceOrgId(next echo.HandlerFunc) echo.HandlerFunc
- func ExtractStatus(next echo.HandlerFunc) echo.HandlerFunc
- func LogServerErrorRequest(next echo.HandlerFunc) echo.HandlerFunc
- func MatchedRoute(ctx echo.Context) string
- func MetricsMiddlewareWithConfig(config *MetricsConfig) echo.MiddlewareFunc
- func NewRbac(rbacConfig Rbac) echo.MiddlewareFunc
- func SkipAuth(p string) bool
- func SkipEnforceConsistentOrgId(c echo.Context) bool
- func SkipMiddleware(c echo.Context) bool
- func SkipRbac(c echo.Context, p string) bool
- func WrapMiddlewareWithSkipper(m func(http.Handler) http.Handler, skip echo_middleware.Skipper) echo.MiddlewareFunc
- type BufferedReadCloser
- type MetricsConfig
- type Rbac
Constants ¶
View Source
const ( JSONMimeType = "application/json" FormDataMimeType = "multipart/form-data" URLEncodedMimeType = "application/x-www-form-urlencoded" )
View Source
const BodyDumpLimit = 1000
View Source
const BodyStoreKey = "body_backup"
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 EnforceConsistentOrgId ¶
func EnforceConsistentOrgId(next echo.HandlerFunc) echo.HandlerFunc
EnforceConsistentOrgId middleware checks that the user's org ID from identity header matches the org_id in any returned data using a generic approach
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 LogServerErrorRequest ¶
func LogServerErrorRequest(next echo.HandlerFunc) echo.HandlerFunc
func MatchedRoute ¶
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 NewRbac ¶
func NewRbac(rbacConfig Rbac) echo.MiddlewareFunc
func SkipMiddleware ¶
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 BufferedReadCloser ¶
type BufferedReadCloser struct {
*bufio.Reader
io.ReadCloser
}
func (BufferedReadCloser) Close ¶
func (rw BufferedReadCloser) Close() error
type MetricsConfig ¶
type MetricsConfig struct {
Skipper echo_middleware.Skipper
Metrics *instrumentation.Metrics
}
type Rbac ¶
type Rbac struct {
BaseUrl string
Skipper echo_middleware.Skipper
RbacClient rbac.ClientWrapper
KesselClient rbac.ClientWrapper
PermissionsMap *rbac.PermissionsMap
}
Click to show internal directories.
Click to hide internal directories.