MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / Enabled

Function Enabled

internal/feature/features.go:126–129  ·  view source on GitHub ↗

Enabled indicates if a Feature is enabled in the Gate contained in ctx. It returns false when there is no Gate.

(ctx context.Context, f Feature)

Source from the content-addressed store, hash-verified

124// Enabled indicates if a Feature is enabled in the Gate contained in ctx. It
125// returns false when there is no Gate.
126func Enabled(ctx context.Context, f Feature) bool {
127 gate, ok := ctx.Value(contextKey{}).(Gate)
128 return ok && gate.Enabled(f)
129}
130
131// NewContext returns a copy of ctx containing gate. Check it using [Enabled].
132func NewContext(ctx context.Context, gate Gate) context.Context {

Calls 2

ValueMethod · 0.80
EnabledMethod · 0.65

Tested by 1

TestContextFunction · 0.68