Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextResolver ¶
func ContextResolver() contextResolver
func NewMiddleware ¶
func NewMiddleware[Request any, Response any](getNamespace func(ctx context.Context) (string, bool), checker *FeatureGateChecker) operation.Middleware[Request, Response]
Types ¶
type FeatureFlag ¶
type FeatureFlag string
const (
CtxKeyCredits FeatureFlag = "om_ff_credits_enabled"
)
func (FeatureFlag) String ¶
func (f FeatureFlag) String() string
type FeatureGateChecker ¶
type FeatureGateChecker struct {
Gate Gate
Flags Flags
// FlagOverrides is used to handle config level feature setups
// ex. if a feature is disabled on config level, then we are not going to call the feature gate
FlagOverrides map[FeatureFlag]bool
// contains filtered or unexported fields
}
func NewFeatureGateChecker ¶
func NewFeatureGateChecker(gate Gate, flags Flags, flagOverrides map[FeatureFlag]bool) *FeatureGateChecker
func (*FeatureGateChecker) Enabled ¶
func (h *FeatureGateChecker) Enabled(ns string, flag string) (bool, error)
func (*FeatureGateChecker) Validate ¶
func (h *FeatureGateChecker) Validate() error
type Flags ¶
type Flags map[FeatureFlag]string
func (*Flags) Keys ¶
func (f *Flags) Keys() []FeatureFlag
Click to show internal directories.
Click to hide internal directories.