Copyright | Copyright © FINN.no AS Inc. All rights reserved. |
---|---|
License | MIT |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Functions and types for checking feature toggles and variants.
Synopsis
- type Features = Map FeatureToggleName Feature
- data Context = Context {}
- emptyContext :: Context
- emptyVariantResponse :: VariantResponse
- featureIsEnabled :: MonadIO m => Features -> FeatureToggleName -> Context -> m Bool
- featureGetVariant :: MonadIO m => Features -> FeatureToggleName -> Context -> m VariantResponse
- data MetricsPayload = MetricsPayload {}
- data RegisterPayload = RegisterPayload {
- appName :: Text
- instanceId :: Text
- started :: UTCTime
- intervalSeconds :: Int
- data VariantResponse = VariantResponse {}
Documentation
type Features = Map FeatureToggleName Feature Source #
Map of feature toggles keyed on toggle names. Typically the full set of features fetched from a server.
Client context.
Context | |
|
Instances
emptyContext :: Context Source #
An initial client context.
emptyVariantResponse :: VariantResponse Source #
The default (disabled) variant response.
:: MonadIO m | |
=> Features | Full set of features fetched from a server. |
-> FeatureToggleName | Feature toggle name (as it is represented on the server). |
-> Context | User context. |
-> m Bool | Feature toggle state. |
Check whether or not a feature toggle is enabled.
:: MonadIO m | |
=> Features | Full set of features fetched from a server. |
-> FeatureToggleName | Feature toggle name (as it is represented on the server). |
-> Context | User context. |
-> m VariantResponse | Variant. |
Get a variant for a given feature toggle.
data MetricsPayload Source #
Metrics payload.
Instances
data RegisterPayload Source #
Client registration payload.
RegisterPayload | |
|
Instances
data VariantResponse Source #
Variant response.