Documentation
¶
Overview ¶
Package features contains example feature definitions for the component architecture.
Index ¶
- func NewLegacyBehaviorFeature(version string) feature.Mutation[*resources.DeploymentResourceMutator]
- func NewLegacyCompatibilityFeature(version string) feature.Mutation[*resources.DeploymentResourceMutator]
- func NewTracingFeature(version string, enabled bool) feature.Mutation[*resources.DeploymentResourceMutator]
- type ExampleVersionConstraint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLegacyBehaviorFeature ¶
func NewLegacyBehaviorFeature(version string) feature.Mutation[*resources.DeploymentResourceMutator]
NewLegacyBehaviorFeature creates a Feature Mutation for older versions (< 8.0.0). It demonstrates how Feature Mutations are used to apply legacy behavior for backwards compatibility, such as adding deprecated configuration or reverting modern defaults to legacy values.
func NewLegacyCompatibilityFeature ¶
func NewLegacyCompatibilityFeature(version string) feature.Mutation[*resources.DeploymentResourceMutator]
NewLegacyCompatibilityFeature creates a Feature Mutation enabled for versions < 9.0.0. This demonstrates the use of Feature Mutations for backward compatibility, adding legacy flags and removing modern settings using the restricted mutator.
func NewTracingFeature ¶
func NewTracingFeature(version string, enabled bool) feature.Mutation[*resources.DeploymentResourceMutator]
NewTracingFeature creates a Feature Mutation that is enabled for versions >= 8.1.0, and only if the boolean flag is true. It demonstrates how to use Additional boolean gating with the When() method on the ResourceFeature to combine semver with other feature toggles.
Types ¶
type ExampleVersionConstraint ¶
type ExampleVersionConstraint struct {
// contains filtered or unexported fields
}
ExampleVersionConstraint is a simple implementation of feature.VersionConstraint for the component-architecture example. It uses semantic versioning to determine if a feature is enabled.
func MustRegister ¶
func MustRegister(name, constraint string) *ExampleVersionConstraint
MustRegister is a convenience function that panics if the constraint is invalid.
func NewExampleVersionConstraint ¶
func NewExampleVersionConstraint(name, constraint string) (*ExampleVersionConstraint, error)
NewExampleVersionConstraint creates a new ExampleVersionConstraint from a semver constraint string.