middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attributes

func Attributes(fn func(*http.Request) engine.Attributes) func(http.Handler) http.Handler

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

func RequireFlags(ff featureflags.Checker, flags []string) func(http.Handler) http.Handler

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.

Jump to

Keyboard shortcuts

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