Documentation ¶
Overview ¶
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
nolint
Index ¶
- Variables
- type FeatureFlagRetrieverMock
- func (f *FeatureFlagRetrieverMock) GetFeatureFlag(name string) (enabled, exists bool)
- func (f *FeatureFlagRetrieverMock) ShouldGetExistingFeatureFlag(name string, enabled bool)
- func (f *FeatureFlagRetrieverMock) ShouldGetFeatureFlag(name string, enabled bool, exists bool)
- func (f *FeatureFlagRetrieverMock) ShouldNotGetFeatureFlag(name string)
- type FeatureFlags
- type Manager
- type Retriever
- type Setter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFeatureFlagAlreadyExists = errors.New("feature flag already exists")
)
Functions ¶
This section is empty.
Types ¶
type FeatureFlagRetrieverMock ¶ added in v0.1.0
func (*FeatureFlagRetrieverMock) GetFeatureFlag ¶ added in v0.1.0
func (f *FeatureFlagRetrieverMock) GetFeatureFlag(name string) (enabled, exists bool)
func (*FeatureFlagRetrieverMock) ShouldGetExistingFeatureFlag ¶ added in v0.1.0
func (f *FeatureFlagRetrieverMock) ShouldGetExistingFeatureFlag(name string, enabled bool)
func (*FeatureFlagRetrieverMock) ShouldGetFeatureFlag ¶ added in v0.1.0
func (f *FeatureFlagRetrieverMock) ShouldGetFeatureFlag(name string, enabled bool, exists bool)
func (*FeatureFlagRetrieverMock) ShouldNotGetFeatureFlag ¶ added in v0.1.0
func (f *FeatureFlagRetrieverMock) ShouldNotGetFeatureFlag(name string)
type FeatureFlags ¶
type FeatureFlags struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(initialFeatureFlags map[string]bool) *FeatureFlags
func (*FeatureFlags) GetFeatureFlag ¶
func (f *FeatureFlags) GetFeatureFlag(name string) (enabled, exists bool)
GetFeatureFlag returns if a FF is enabled and exists
func (*FeatureFlags) SetFeatureFlag ¶
func (f *FeatureFlags) SetFeatureFlag(name string, enabled bool) error
SetFeatureFlag adds a new FF to the config. FFs can be defined in the agent's config file or they may come from the Command Channel. As the command channel runs asynchronously, we need to lock the feature flags.
Click to show internal directories.
Click to hide internal directories.