unleash-client-haskell-core-0.8.9: 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

type Features = Map FeatureToggleName Feature Source #

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

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 #

aplg ~ Maybe Text => HasField "appName" Context aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: Context -> (aplg -> Context, aplg) #

aplg ~ Maybe Text => HasField "currentTime" Context aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: Context -> (aplg -> Context, aplg) #

aplg ~ Maybe Text => HasField "environment" Context aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: Context -> (aplg -> Context, aplg) #

aplg ~ Maybe (Map Text (Maybe Text)) => HasField "properties" Context aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: Context -> (aplg -> Context, aplg) #

aplg ~ Maybe Text => HasField "remoteAddress" Context aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: Context -> (aplg -> Context, aplg) #

aplg ~ Maybe Text => HasField "sessionId" Context aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: Context -> (aplg -> Context, aplg) #

aplg ~ Maybe Text => HasField "userId" Context aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: Context -> (aplg -> Context, aplg) #

type Rep Context Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

emptyContext :: Context Source #

An initial client context.

emptyVariantResponse :: VariantResponse Source #

The default (disabled) variant response.

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.

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.

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

aplg ~ Text => HasField "appName" MetricsPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: MetricsPayload -> (aplg -> MetricsPayload, aplg) #

aplg ~ Text => HasField "instanceId" MetricsPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: MetricsPayload -> (aplg -> MetricsPayload, aplg) #

aplg ~ UTCTime => HasField "start" MetricsPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: MetricsPayload -> (aplg -> MetricsPayload, aplg) #

aplg ~ UTCTime => HasField "stop" MetricsPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: MetricsPayload -> (aplg -> MetricsPayload, aplg) #

aplg ~ [(Text, Bool)] => HasField "toggles" MetricsPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: MetricsPayload -> (aplg -> MetricsPayload, aplg) #

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

aplg ~ Text => HasField "appName" RegisterPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: RegisterPayload -> (aplg -> RegisterPayload, aplg) #

aplg ~ Text => HasField "instanceId" RegisterPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: RegisterPayload -> (aplg -> RegisterPayload, aplg) #

aplg ~ Int => HasField "intervalSeconds" RegisterPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: RegisterPayload -> (aplg -> RegisterPayload, aplg) #

aplg ~ UTCTime => HasField "started" RegisterPayload aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: RegisterPayload -> (aplg -> RegisterPayload, aplg) #

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.8.9-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 "started") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "intervalSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))

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

aplg ~ Bool => HasField "enabled" VariantResponse aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: VariantResponse -> (aplg -> VariantResponse, aplg) #

aplg ~ Text => HasField "name" VariantResponse aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: VariantResponse -> (aplg -> VariantResponse, aplg) #

aplg ~ Maybe Payload => HasField "payload" VariantResponse aplg Source # 
Instance details

Defined in Unleash.Internal.JsonTypes

Methods

hasField :: VariantResponse -> (aplg -> VariantResponse, aplg) #

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.8.9-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))))