Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllFeatures ¶
type AllFeatures struct{}
AllFeatures is intended for tests and returns enabled = true for every Feature
func All ¶
func All() *AllFeatures
All returns a Features instance with all features enabled. For tests only
func (*AllFeatures) FeatureEnabled ¶
func (f *AllFeatures) FeatureEnabled(_ FeatureID) bool
FeatureEnabled check
type FeatureID ¶
type FeatureID string
FeatureID type ensures well-defined list of features in this file
type Features ¶
type Features interface { // FeatureEnabled is used to check whether a feature is enabled FeatureEnabled(feature FeatureID) bool }
Features is used to determine whether StackState supports a certain feature or not
type FetchFeatures ¶
type FetchFeatures struct {
// contains filtered or unexported fields
}
FetchFeatures uses the StackState api to retrieve the supported feature set
func InitFeatures ¶
func InitFeatures() *FetchFeatures
InitFeatures will call out to StackState and will intentionally wait for a response. This ensures that before any checks are run the supported feature set has been determined. The feature set will not be updated but remains fixed for the runtime of the agent. This together allows checks to not worry about changes in supported features while running and avoids potential bugs in stateful checks.
The trade-off is that an upgrade to StackState will only be recognized after an agent restart
func InitTestFeatures ¶
func InitTestFeatures(stsClient httpclient.RetryableHTTPClient) *FetchFeatures
InitTestFeatures is for tests only and allows injecting a stub for the httpclient
func (*FetchFeatures) FeatureEnabled ¶
func (ff *FetchFeatures) FeatureEnabled(feature FeatureID) bool
FeatureEnabled check