MCPcopy
hub / github.com/etcd-io/etcd / featureGate

Struct featureGate

pkg/featuregate/feature_gate.go:129–144  ·  view source on GitHub ↗

featureGate implements FeatureGate as well as pflag.Value for flag parsing.

Source from the content-addressed store, hash-verified

127
128// featureGate implements FeatureGate as well as pflag.Value for flag parsing.
129type featureGate struct {
130 lg *zap.Logger
131
132 featureGateName string
133
134 special map[Feature]func(map[Feature]FeatureSpec, map[Feature]bool, bool)
135
136 // lock guards writes to known, enabled, and reads/writes of closed
137 lock sync.Mutex
138 // known holds a map[Feature]FeatureSpec
139 known atomic.Value
140 // enabled holds a map[Feature]bool
141 enabled atomic.Value
142 // closed is set to true when AddFlag is called, and prevents subsequent calls to Add
143 closed bool
144}
145
146func setUnsetAlphaGates(known map[Feature]FeatureSpec, enabled map[Feature]bool, val bool) {
147 for k, v := range known {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected