Documentation ¶
Index ¶
- func Annotate(ctx context.Context, f Flagger, flags ...Flag) (context.Context, error)
- func ExposedFlagsFromContext(ctx context.Context, byKey ByKeyFn) map[string]interface{}
- func FlagsFromContext(ctx context.Context) map[string]interface{}
- func NewFlagsHandler(errorHandler HTTPErrorHandler, byKey ByKeyFn) http.Handler
- func NewHandler(log *zap.Logger, flagger Flagger, flags []Flag, next http.Handler) http.Handler
- type Base
- type BoolFlag
- func AppMetrics() BoolFlag
- func DefaultMonacoSelectionToEof() BoolFlag
- func EnforceOrganizationDashboardLimits() BoolFlag
- func GroupWindowAggregateTranspose() BoolFlag
- func InjectLatestSuccessTime() BoolFlag
- func MakeBoolFlag(name, key, owner string, defaultValue bool, lifetime Lifetime, expose bool) BoolFlag
- func MemoryOptimizedFill() BoolFlag
- func MemoryOptimizedSchemaMutation() BoolFlag
- func NewDashboardAutorefresh() BoolFlag
- func NewLabelPackage() BoolFlag
- func QueryTracing() BoolFlag
- func RefreshSingleCell() BoolFlag
- func TimeFilterFlags() BoolFlag
- type ByKeyFn
- type Flag
- type Flagger
- type FloatFlag
- type HTTPErrorHandler
- type Handler
- type IntFlag
- type Lifetime
- type StringFlag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExposedFlagsFromContext ¶
ExposedFlagsFromContext returns the filtered map of exposed flags attached to the context by Annotate, or nil if none is found.
func FlagsFromContext ¶
FlagsFromContext returns the map of flags attached to the context by Annotate, or nil if none is found.
func NewFlagsHandler ¶
func NewFlagsHandler(errorHandler HTTPErrorHandler, byKey ByKeyFn) http.Handler
NewFlagsHandler returns a handler that returns the map of computed feature flags on the request context.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
flag base type.
func MakeBase ¶
func MakeBase(name, key, owner string, defaultValue interface{}, lifetime Lifetime, expose bool) Base
MakeBase constructs a flag flag.
type BoolFlag ¶
type BoolFlag struct { Base // contains filtered or unexported fields }
BoolFlag implements Flag for boolean values.
func AppMetrics ¶
func AppMetrics() BoolFlag
AppMetrics - Send UI Telementry to Tools cluster - should always be false in OSS
func DefaultMonacoSelectionToEof ¶
func DefaultMonacoSelectionToEof() BoolFlag
DefaultMonacoSelectionToEof - Positions the cursor at the end of the line(s) when using the monaco editor
func EnforceOrganizationDashboardLimits ¶
func EnforceOrganizationDashboardLimits() BoolFlag
EnforceOrganizationDashboardLimits - Enforces the default limit params for the dashboards api when orgs are set
func GroupWindowAggregateTranspose ¶
func GroupWindowAggregateTranspose() BoolFlag
GroupWindowAggregateTranspose - Enables the GroupWindowAggregateTransposeRule for all enabled window aggregates
func InjectLatestSuccessTime ¶
func InjectLatestSuccessTime() BoolFlag
InjectLatestSuccessTime - Inject the latest successful task run timestamp into a Task query extern when executing.
func MakeBoolFlag ¶
func MakeBoolFlag(name, key, owner string, defaultValue bool, lifetime Lifetime, expose bool) BoolFlag
MakeBoolFlag returns a string flag with the given Base and default.
func MemoryOptimizedFill ¶
func MemoryOptimizedFill() BoolFlag
MemoryOptimizedFill - Enable the memory optimized fill()
func MemoryOptimizedSchemaMutation ¶
func MemoryOptimizedSchemaMutation() BoolFlag
MemoryOptimizedSchemaMutation - Enable the memory optimized schema mutation functions
func NewDashboardAutorefresh ¶
func NewDashboardAutorefresh() BoolFlag
NewDashboardAutorefresh - Enables the new dashboard autorefresh controls in the UI
func NewLabelPackage ¶
func NewLabelPackage() BoolFlag
NewLabelPackage - Enables the refactored labels api
func QueryTracing ¶
func QueryTracing() BoolFlag
QueryTracing - Turn on query tracing for queries that are sampled
func RefreshSingleCell ¶
func RefreshSingleCell() BoolFlag
RefreshSingleCell - Refresh a single cell on the dashboard rather than the entire dashboard
func TimeFilterFlags ¶
func TimeFilterFlags() BoolFlag
TimeFilterFlags - Filter task run list based on before and after flags
type Flag ¶
type Flag interface { // Key returns the programmatic backend identifier for the flag. Key() string // Default returns the type-agnostic zero value for the flag. // Type-specific flag implementations may expose a typed default // (e.g. BoolFlag includes a boolean Default field). Default() interface{} // Expose the flag. Expose() bool }
Flag represents a generic feature flag with a key and a default.
type Flagger ¶
type Flagger interface { // Flags returns a map of flag keys to flag values. // // If an authorization is present on the context, it may be used to compute flag // values according to the affiliated user ID and its organization and other mappings. // Otherwise, they should be computed generally or return a default. // // One or more flags may be provided to restrict the results. // Otherwise, all flags should be computed. Flags(context.Context, ...Flag) (map[string]interface{}, error) }
Flagger returns flag values.
func DefaultFlagger ¶
func DefaultFlagger() Flagger
DefaultFlagger returns a flagger that always returns default values.
type FloatFlag ¶
type FloatFlag struct { Base // contains filtered or unexported fields }
FloatFlag implements Flag for float values.
type HTTPErrorHandler ¶
type HTTPErrorHandler interface {
HandleHTTPError(ctx context.Context, err error, w http.ResponseWriter)
}
HTTPErrorHandler is an influxdb.HTTPErrorHandler. It's defined here instead of referencing the other interface type, because we want to try our best to avoid cyclical dependencies when feature package is used throughout the codebase.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a middleware that annotates the context with a map of computed feature flags. To accurately compute identity-scoped flags, this middleware should be executed after any authorization middleware has annotated the request context with an authorizer.
type IntFlag ¶
type IntFlag struct { Base // contains filtered or unexported fields }
IntFlag implements Flag for integer values.
type Lifetime ¶
type Lifetime int
Lifetime represents the intended lifetime of the feature flag.
The zero value is Temporary, the most common case, but Permanent is included to mark special cases where a flag is not intended to be removed, e.g. enabling debug tracing for an organization.
TODO(gavincabbage): This may become a stale date, which can then
be used to trigger a notification to the contact when the flag has become stale, to encourage flag cleanup.
func (*Lifetime) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler and interprets a case-insensitive text representation as a lifetime constant.
type StringFlag ¶
type StringFlag struct { Base // contains filtered or unexported fields }
StringFlag implements Flag for string values.
func MakeStringFlag ¶
func MakeStringFlag(name, key, owner string, defaultValue string, lifetime Lifetime, expose bool) StringFlag
MakeStringFlag returns a string flag with the given Base and default.