Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSelectorMiddleware ¶
func NewSelectorMiddleware(matcher Matcher, middlewares ...httpx.Middleware) httpx.Middleware
NewSelectorMiddleware creates a chain of middleware that only execute when the matcher condition is met. This allows conditional application of middleware based on request characteristics.
Types ¶
type MatchFunc ¶
MatchFunc is a function type that implements the Matcher interface. This allows functions to be used directly as matchers without defining new types.
type Matcher ¶
Matcher defines the interface for request matching logic. Implementations determine whether a given request context matches specific criteria.
func NewContextMatcher ¶
func NewContextMatcher[T comparable](key string, value T) Matcher
NewContextMatcher creates a matcher that checks for a specific value in the Gin context. It performs type-safe comparison of context values.
func NewLogicalAndMatcher ¶
NewLogicalAndMatcher creates a matcher that returns true only if all provided matchers match. It implements logical AND operation across multiple matchers.
func NewLogicalNotMatcher ¶
NewLogicalNotMatcher creates a matcher that inverts the result of another matcher.
func NewLogicalOrMatcher ¶
NewLogicalOrMatcher creates a matcher that returns true if any of the provided matchers match. It implements logical OR operation across multiple matchers.