unleash-client-haskell-core-0.11.0: Unleash feature toggle client core
CopyrightCopyright © FINN.no AS Inc. All rights reserved.
LicenseMIT
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unleash

Description

Functions and types for checking feature toggles and variants.

Synopsis

Documentation

data Context Source #

Client context.

Constructors

Context 

Fields

Instances

Instances details
FromJSON Context Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

ToJSON Context Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Generic Context Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Associated Types

type Rep Context :: Type -> Type #

Methods

from :: Context -> Rep Context x #

to :: Rep Context x -> Context #

Show Context Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Eq Context Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

(==) :: Context -> Context -> Bool #

(/=) :: Context -> Context -> Bool #

type Rep Context Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

defaultStrategyEvaluator :: StrategyEvaluator Source #

Implementation of default strategies.

defaultSupportedStrategies :: SupportedStrategies Source #

A list of currently supported strategies for this library.

emptyContext :: Context Source #

An initial client context.

emptyVariantResponse :: VariantResponse Source #

The default (disabled) variant response.

featureGetVariant Source #

Arguments

:: 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.

featureIsEnabled Source #

Arguments

:: 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.

type Features = Map FeatureToggleName Feature Source #

Map of feature toggles keyed on toggle names. Typically the full set of features fetched from a server.

type FeatureToggleName = Text Source #

Alias used for feature toggle names (as they are represented on Unleash servers).

data MetricsPayload Source #

Metrics payload.

Constructors

MetricsPayload 

Fields

Instances

Instances details
Generic MetricsPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Associated Types

type Rep MetricsPayload :: Type -> Type #

Show MetricsPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Eq MetricsPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

type Rep MetricsPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

type Rep MetricsPayload = D1 ('MetaData "MetricsPayload" "Unleash.Internal.JsonTypes" "unleash-client-haskell-core-0.11.0-inplace" 'False) (C1 ('MetaCons "MetricsPayload" 'PrefixI 'True) ((S1 ('MetaSel ('Just "appName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "start") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "stop") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "toggles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, Bool)])))))

data RegisterPayload Source #

Client registration payload.

Constructors

RegisterPayload 

Fields

Instances

Instances details
ToJSON RegisterPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Generic RegisterPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Associated Types

type Rep RegisterPayload :: Type -> Type #

Show RegisterPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Eq RegisterPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

type Rep RegisterPayload Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

type Rep RegisterPayload = D1 ('MetaData "RegisterPayload" "Unleash.Internal.JsonTypes" "unleash-client-haskell-core-0.11.0-inplace" 'False) (C1 ('MetaCons "RegisterPayload" 'PrefixI 'True) ((S1 ('MetaSel ('Just "appName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "strategies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SupportedStrategies) :*: (S1 ('MetaSel ('Just "started") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "intervalSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))))

data Strategy Source #

Strategy. Encompasses all (supported) types of strategies.

Instances

Instances details
FromJSON Strategy Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

ToJSON Strategy Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Generic Strategy Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Associated Types

type Rep Strategy :: Type -> Type #

Methods

from :: Strategy -> Rep Strategy x #

to :: Rep Strategy x -> Strategy #

Show Strategy Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Eq Strategy Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

type Rep Strategy Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

type Rep Strategy = D1 ('MetaData "Strategy" "Unleash.Internal.JsonTypes" "unleash-client-haskell-core-0.11.0-inplace" 'False) (C1 ('MetaCons "Strategy" 'PrefixI 'True) ((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Map Text Text)))) :*: (S1 ('MetaSel ('Just "constraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Constraint])) :*: S1 ('MetaSel ('Just "segments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Int])))))

type StrategyEvaluator = forall m. MonadIO m => Strategy -> FeatureToggleName -> Context -> m Bool Source #

Functions that implement strategies.

type SupportedStrategies = [Text] Source #

Alias for a list of supported strategies.

data VariantResponse Source #

Variant response.

Constructors

VariantResponse 

Fields

Instances

Instances details
FromJSON VariantResponse Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

ToJSON VariantResponse Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Generic VariantResponse Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Associated Types

type Rep VariantResponse :: Type -> Type #

Show VariantResponse Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Eq VariantResponse Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

type Rep VariantResponse Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

type Rep VariantResponse = D1 ('MetaData "VariantResponse" "Unleash.Internal.JsonTypes" "unleash-client-haskell-core-0.11.0-inplace" 'False) (C1 ('MetaCons "VariantResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "payload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Payload)) :*: S1 ('MetaSel ('Just "enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))