Help us shape the future of Go! Take the 2026 Go Developer Survey

middleware

package
v0.112.14 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IsExchangeTokenContextKey is the context key used to indicate that the request
	// is authenticated with an exchange token.
	IsExchangeTokenContextKey = "is_exchange_token"

	// StatusClientClosedRequest is the non-standard status code (nginx convention) for a
	// client that disconnected before the server could respond. Go's net/http has no
	// constant for it.
	StatusClientClosedRequest = 499
)

Variables

This section is empty.

Functions

func WebhookRateLimitMiddleware added in v0.70.0

func WebhookRateLimitMiddleware(rateLimit rate.Limit, burst int, l *zerolog.Logger) echo.MiddlewareFunc

Types

type MiddlewareFunc

type MiddlewareFunc func(r *RouteInfo) echo.HandlerFunc

type MiddlewareHandler

type MiddlewareHandler struct {
	// contains filtered or unexported fields
}

func NewMiddlewareHandler

func NewMiddlewareHandler(swagger *openapi3.T) (*MiddlewareHandler, error)

func (*MiddlewareHandler) Middleware

func (m *MiddlewareHandler) Middleware() (echo.MiddlewareFunc, error)

func (*MiddlewareHandler) Use

func (m *MiddlewareHandler) Use(mw MiddlewareFunc)

type RouteInfo

type RouteInfo struct {
	OperationID string
	Security    SecurityRequirement
	Resources   []string
	Route       *routers.Route
}

type SecurityRequirement

type SecurityRequirement interface {
	IsOptional() bool
	NoAuth() bool
	CookieAuth() bool
	BearerAuth() bool
	CustomAuth() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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