Documentation
¶
Index ¶
- func Attributes(fn func(*http.Request) engine.Attributes) func(http.Handler) http.Handler
- func PreCheckFeatureFlags(ffMgr *featureflags.FeatureFlagManager, checkFlags []string) func(http.Handler) http.Handlerdeprecated
- func RequireFlags(ff featureflags.Checker, flags []string) func(http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attributes ¶
Attributes is HTTP middleware that puts the attributes fn returns for a request in its context once, so every flag evaluation further down the chain sees them (see engine.WithAttributes). fn may return nil; the request still gets its own resolver cache.
func PreCheckFeatureFlags
deprecated
func PreCheckFeatureFlags(ffMgr *featureflags.FeatureFlagManager, checkFlags []string) func(http.Handler) http.Handler
PreCheckFeatureFlags is an HTTP middleware that conditionally allows requests to proceed based on the status of specific feature flags. It checks if all specified feature flags are enabled in the FeatureFlagManager.
Example: if FF_LOGIN=true and FF_SIGNUP=false, and you check for SIGNUP,
the middleware will block the request with a 403 Forbidden.
Deprecated: use RequireFlags, which evaluates flags for the request's attributes. Removed in v2.
func RequireFlags ¶
RequireFlags is HTTP middleware that lets a request through only when every flag in flags is on for it. Flags are evaluated with the request context, so the attributes set by Attributes earlier in the chain apply. A disabled flag answers 403; an evaluation error, such as an unknown flag, answers 500.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package grpc has gRPC server interceptors that put each call's common flag attributes in its context, the gRPC counterpart of middleware.Attributes.
|
Package grpc has gRPC server interceptors that put each call's common flag attributes in its context, the gRPC counterpart of middleware.Attributes. |