C Server-Side SDK
LaunchDarkly SDK
LDStoreInterface Struct Reference

An opaque client object. More...

#include <store.h>

Data Fields

void * context
 Used to store implementation specific data.
 
LDBoolean(* init )(void *const context, const struct LDStoreCollectionState *collections, const unsigned int collectionCount)
 Initialize the feature store with a new data set. More...
 
LDBoolean(* get )(void *const context, const char *const kind, const char *const featureKey, struct LDStoreCollectionItem *const result)
 Fetch a feature from the store. More...
 
LDBoolean(* all )(void *const context, const char *const kind, struct LDStoreCollectionItem **const result, unsigned int *const resultCount)
 Fetch all features in a given namespace. More...
 
LDBoolean(* upsert )(void *const context, const char *const kind, const struct LDStoreCollectionItem *const feature, const char *const featureKey)
 Replace an existing feature with a newer one or delete a feature. More...
 
LDBoolean(* initialized )(void *const context)
 Determine if the store is initialized with features yet. More...
 
void(* destructor )(void *const context)
 Destroy the implementation specific context associated. More...
 

Detailed Description

An opaque client object.

Field Documentation

◆ all

LDBoolean(* LDStoreInterface::all) (void *const context, const char *const kind, struct LDStoreCollectionItem **const result, unsigned int *const resultCount)

Fetch all features in a given namespace.

Parameters
[in]contextImplementation specific context. May not be NULL (assert).
[in]kindThe namespace to search in. May not be NULL (assert).
[out]resultReturns an array of raw items.
[out]resultCount Returns the number of items in the result array.
Returns
True on success, False on failure.

◆ destructor

void(* LDStoreInterface::destructor) (void *const context)

Destroy the implementation specific context associated.

Parameters
[in]contextImplementation specific context. May not be NULL (assert).
Returns
Void.

◆ get

LDBoolean(* LDStoreInterface::get) (void *const context, const char *const kind, const char *const featureKey, struct LDStoreCollectionItem *const result)

Fetch a feature from the store.

Parameters
[in]contextImplementation specific context. May not be NULL (assert).
[in]kindThe namespace to search in. May not be NULL (assert).
[in]featureKeyThe key to return the value for. May not be NULL (assert).
[out]resultReturns the feature, or NULL if it does not exist.
Returns
True on success, False on failure.

◆ init

LDBoolean(* LDStoreInterface::init) (void *const context, const struct LDStoreCollectionState *collections, const unsigned int collectionCount)

Initialize the feature store with a new data set.

Parameters
[in]contextImplementation specific context.
[in]collectionsAn array of namespaces of store items.
[in]collectionCountThe number of items in the array.
Returns
True on success, False on failure.

◆ initialized

LDBoolean(* LDStoreInterface::initialized) (void *const context)

Determine if the store is initialized with features yet.

Parameters
[in]contextImplementation specific context. May not be NULL (assert).
Returns
True if the store is initialized, false otherwise.

◆ upsert

LDBoolean(* LDStoreInterface::upsert) (void *const context, const char *const kind, const struct LDStoreCollectionItem *const feature, const char *const featureKey)

Replace an existing feature with a newer one or delete a feature.

Parameters
[in]contextImplementation specific context. May not be NULL (assert).
[in]kindThe namespace to search in. May not be NULL (assert).
[in]featureThe updated feature. Only deletes current if version is newer. This is also used to delete a feature. May not be NULL (assert).
[in]featureKeyKey of the new item.
Returns
True on success, False on failure.

The documentation for this struct was generated from the following file: