Repository navigation
Expand file tree
/
Copy pathfeature.go
More file actions
57 lines (52 loc) · 2.28 KB
/
Copy pathfeature.go
File metadata and controls
57 lines (52 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package gatekit
// Feature is the stable identifier of a gated behavior.
type Feature string
// FeatureSpec declares a feature's default and maturity from a given activation
// version onward. A feature carries one spec per version at which its default or
// maturity changes; the spec in force is the one with the highest ActiveFrom that
// is less than or equal to the current activation version.
//
// Example lifecycle for a feature introduced at activation 5 and promoted at 6:
//
// VersionedSpecs{
// {ActiveFrom: 5, Default: false, Maturity: Beta},
// {ActiveFrom: 6, Default: true, Maturity: GA},
// }
type FeatureSpec struct {
// ActiveFrom is the activation version at which this spec takes effect.
ActiveFrom Activation
// Default is whether the feature is on at or after ActiveFrom, unless a later
// spec overrides it.
Default bool
// Maturity is the feature's lifecycle stage at this version.
Maturity Maturity
}
// VersionedSpecs is a feature's lifecycle across activation versions. Order does
// not matter at declaration time; gatekit sorts by ActiveFrom when the gate is built.
type VersionedSpecs []FeatureSpec
// FeatureDef is a feature's registry entry: its versioned specs plus an optional
// human-readable description.
//
// Registry{
// SplitCatalog: {
// Description: "Load the per-minor split catalog instead of the single file",
// Specs: VersionedSpecs{
// {ActiveFrom: 5, Default: false, Maturity: Beta},
// {ActiveFrom: 6, Default: true, Maturity: GA},
// },
// },
// }
type FeatureDef struct {
// Description is a human-readable summary of the feature, for operator-facing
// listings, generated docs, and the plan / dry-run output. It is informational
// only: it never affects resolution or the run invariant, and MAY be empty.
Description string
// RemoveBy is the activation version by which the feature must be deleted: once
// the supported floor (Min) reaches it, Lint reports the feature. It is lint
// metadata only and never affects resolution. Zero means no removal deadline.
RemoveBy Activation
// Specs is the feature's lifecycle across activation versions.
Specs VersionedSpecs
}
// Registry maps each feature to its definition (description + versioned specs).
type Registry map[Feature]FeatureDef