middleware

package
v0.0.0-...-f6d42a1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 NewRbac

func NewRbac(config Rbac) echo.MiddlewareFunc

func SkipAuth

func SkipAuth(c echo.Context) bool

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
}

Jump to

Keyboard shortcuts

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