launchdarkly-server-sdk-4.4.0: Server-side SDK for integrating with LaunchDarkly
Safe HaskellNone
LanguageHaskell2010

LaunchDarkly.Server.Store

Description

This module contains details for external store implementations.

Synopsis

Documentation

type StoreResult a = IO (Either Text a) Source #

The result type for every PersistentDataStore function. Instead of throwing an exception, any store related error should return Left. Exceptions unrelated to the store should not be caught.

type FeatureKey = Text Source #

Represents the key for a given feature.

type FeatureNamespace = Text Source #

Represents a namespace such as features or segments

data PersistentDataStore Source #

The interface implemented by external stores for use by the SDK.

Constructors

PersistentDataStore 

Fields

data SerializedItemDescriptor Source #

A record representing an object that can be persisted in an external store.

Constructors

SerializedItemDescriptor 

Fields

  • item :: !(Maybe ByteString)

    A serialized item. If the item is deleted or does not exist this should be Nothing.

  • version :: !Natural

    The version of a given item. If the item does not exist this should be zero.

  • deleted :: !Bool

    True if this is a placeholder (tombstone) for a deleted item.

serializeWithPlaceholder :: SerializedItemDescriptor -> ByteString Source #

Generate a ByteString representation of the SerializedItemDescriptor.

If the SerializedItemDescriptor has either a Nothing value, or is marked as deleted, the ByteString representation will be a tombstone marker containing the version and deletion status.

Otherwise, the internal item representation is returned.

byteStringToVersionedData :: ByteString -> Maybe VersionedData Source #

Partially decode the provided ByteString into a VersionedData struct.

This is useful for persistent stores who need to perform version comparsions before persisting data.