Debian Codegraph @

featuregate/stage.go

raw
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package featuregate // import "go.opentelemetry.io/collector/featuregate"
5
6 // Stage represents the Gate's lifecycle and what is the expected state of it.
7 type Stage int8
8
9 const (
10 // StageAlpha is used when creating a new feature and the Gate must be explicitly enabled
11 // by the operator.
12 //
13 // The Gate will be disabled by default.
14 StageAlpha Stage = iota
15 // StageBeta is used when the feature gate is well tested and is enabled by default,
16 // but can be disabled by a Gate.
17 //
18 // The Gate will be enabled by default.
19 StageBeta
20 // StageStable is used when feature is permanently enabled and can not be disabled by a Gate.
21 // This value is used to provide feedback to the user that the gate will be removed in the next versions.
22 //
23 // The Gate will be enabled by default and will return an error if disabled.
24 StageStable
25 // StageDeprecated is used when feature is permanently disabled and can not be enabled by a Gate.
26 // This value is used to provide feedback to the user that the gate will be removed in the next versions.
27 //
28 // The Gate will be disabled by default and will return an error if modified.
29 StageDeprecated
30 )
31
32 func (s Stage) String() string {
33 switch s {
34 case StageAlpha:
35 return "Alpha"
36 case StageBeta:
37 return "Beta"
38 case StageStable:
39 return "Stable"
40 case StageDeprecated:
41 return "Deprecated"
42 }
43 return "Unknown"
44 }