C++ Client-Side SDK
LaunchDarkly SDK
|
#include <launchdarkly/client_side/bindings/c/config/config.h>
#include <launchdarkly/bindings/c/config/logging_builder.h>
#include <launchdarkly/bindings/c/export.h>
#include <launchdarkly/bindings/c/status.h>
#include <stdbool.h>
#include <stddef.h>
Go to the source code of this file.
Classes | |
struct | LDPersistence |
Functions | |
LDPersistence_Init (struct LDPersistence *implementation) | |
LDClientConfigBuilder_New (char const *sdk_key) | |
LDClientConfigBuilder_ServiceEndpoints_PollingBaseURL (LDClientConfigBuilder b, char const *url) | |
LDClientConfigBuilder_ServiceEndpoints_StreamingBaseURL (LDClientConfigBuilder b, char const *url) | |
LDClientConfigBuilder_ServiceEndpoints_EventsBaseURL (LDClientConfigBuilder b, char const *url) | |
LDClientConfigBuilder_ServiceEndpoints_RelayProxyBaseURL (LDClientConfigBuilder b, char const *url) | |
LDClientConfigBuilder_AppInfo_Identifier (LDClientConfigBuilder b, char const *app_id) | |
LDClientConfigBuilder_AppInfo_Version (LDClientConfigBuilder b, char const *app_version) | |
LDClientConfigBuilder_Offline (LDClientConfigBuilder b, bool offline) | |
LDClientConfigBuilder_Events_Enabled (LDClientConfigBuilder b, bool enabled) | |
LDClientConfigBuilder_Events_Capacity (LDClientConfigBuilder b, size_t capacity) | |
LDClientConfigBuilder_Events_FlushIntervalMs (LDClientConfigBuilder b, unsigned int milliseconds) | |
LDClientConfigBuilder_Events_AllAttributesPrivate (LDClientConfigBuilder b, bool all_attributes_private) | |
LDClientConfigBuilder_Events_PrivateAttribute (LDClientConfigBuilder b, char const *attribute_reference) | |
LDClientConfigBuilder_DataSource_WithReasons (LDClientConfigBuilder b, bool with_reasons) | |
LDClientConfigBuilder_DataSource_UseReport (LDClientConfigBuilder b, bool use_report) | |
LDClientConfigBuilder_DataSource_MethodStream (LDClientConfigBuilder b, LDDataSourceStreamBuilder stream_builder) | |
LDClientConfigBuilder_DataSource_MethodPoll (LDClientConfigBuilder b, LDDataSourcePollBuilder poll_builder) | |
LDDataSourceStreamBuilder_New () | |
LDDataSourceStreamBuilder_InitialReconnectDelayMs (LDDataSourceStreamBuilder b, unsigned int milliseconds) | |
LDDataSourceStreamBuilder_Free (LDDataSourceStreamBuilder b) | |
LDDataSourcePollBuilder_New () | |
LDDataSourcePollBuilder_IntervalS (LDDataSourcePollBuilder b, unsigned int seconds) | |
LDDataSourcePollBuilder_Free (LDDataSourcePollBuilder b) | |
LDClientConfigBuilder_HttpProperties_WrapperName (LDClientConfigBuilder b, char const *wrapper_name) | |
LDClientConfigBuilder_HttpProperties_WrapperVersion (LDClientConfigBuilder b, char const *wrapper_version) | |
LDClientConfigBuilder_HttpProperties_Header (LDClientConfigBuilder b, char const *key, char const *value) | |
LDClientConfigBuilder_HttpProperties_Tls (LDClientConfigBuilder b, LDClientHttpPropertiesTlsBuilder tls_builder) | |
LDClientHttpPropertiesTlsBuilder_New (void) | |
LDClientHttpPropertiesTlsBuilder_Free (LDClientHttpPropertiesTlsBuilder b) | |
LDClientHttpPropertiesTlsBuilder_SkipVerifyPeer (LDClientHttpPropertiesTlsBuilder b, bool skip_verify_peer) | |
LDClientHttpPropertiesTlsBuilder_CustomCAFile (LDClientHttpPropertiesTlsBuilder b, char const *custom_ca_file) | |
LDClientConfigBuilder_Logging_Disable (LDClientConfigBuilder b) | |
LDClientConfigBuilder_Logging_Basic (LDClientConfigBuilder b, LDLoggingBasicBuilder basic_builder) | |
LDClientConfigBuilder_Logging_Custom (LDClientConfigBuilder b, LDLoggingCustomBuilder custom_builder) | |
LDPersistenceCustomBuilder_New () | |
LDPersistenceCustomBuilder_Free (LDPersistenceCustomBuilder b) | |
LDPersistenceCustomBuilder_Implementation (LDPersistenceCustomBuilder b, struct LDPersistence impl) | |
LDClientConfigBuilder_Persistence_Custom (LDClientConfigBuilder b, LDPersistenceCustomBuilder custom_builder) | |
LDClientConfigBuilder_Persistence_None (LDClientConfigBuilder b) | |
LDClientConfigBuilder_Build (LDClientConfigBuilder builder, LDClientConfig *out_config) | |
LDClientConfigBuilder_Free (LDClientConfigBuilder builder) | |
LDClientConfigBuilder_AppInfo_Identifier | ( | LDClientConfigBuilder | b, |
char const * | app_id | ||
) |
Sets an identifier for the application.
b | Client config builder. Must not be NULL. |
app_id | Non-empty string. Must be <= 64 chars. Must be alphanumeric, '-', '.', or '_'. Must not be NULL. |
LDClientConfigBuilder_AppInfo_Version | ( | LDClientConfigBuilder | b, |
char const * | app_version | ||
) |
Sets a version for the application.
b | Client config builder. Must not be NULL. |
app_version | Non-empty string. Must be <= 64 chars. Must be alphanumeric, '-', '.', or '_'. Must not be NULL. |
LDClientConfigBuilder_Build | ( | LDClientConfigBuilder | builder, |
LDClientConfig * | out_config | ||
) |
Creates an LDClientConfig. The LDClientConfigBuilder is consumed. On success, the config will be stored in out_config; otherwise, out_config will be set to NULL and the returned LDStatus will indicate the error.
builder | Builder to consume. Must not be NULL. |
out_config | Pointer to where the built config will be stored. Must not be NULL. |
LDClientConfigBuilder_DataSource_MethodPoll | ( | LDClientConfigBuilder | b, |
LDDataSourcePollBuilder | poll_builder | ||
) |
Set the polling configuration for the builder.
A data source may either be streaming or polling. Setting a stream builder indicates the data source will use streaming. Setting a polling builder will indicate the use of polling.
b | Client config builder. Must not be NULL. |
poll_builder | The polling builder. The builder is consumed; do not free it. |
LDClientConfigBuilder_DataSource_MethodStream | ( | LDClientConfigBuilder | b, |
LDDataSourceStreamBuilder | stream_builder | ||
) |
Set the streaming configuration for the builder.
A data source may either be streaming or polling. Setting a streaming builder indicates the data source will use streaming. Setting a polling builder will indicate the use of polling.
b | Client config builder. Must not be NULL. |
stream_builder | The streaming builder. The builder is consumed; do not free it. |
LDClientConfigBuilder_DataSource_UseReport | ( | LDClientConfigBuilder | b, |
bool | use_report | ||
) |
Whether or not to use the REPORT verb to fetch flag settings.
If this is true, flag settings will be fetched with a REPORT request including a JSON entity body with the context object.
Otherwise (by default) a GET request will be issued with the context passed as a base64 URL-encoded path parameter.
Do not use unless advised by LaunchDarkly.
b | Client config builder. Must not be NULL. |
use_reasons | True to use the REPORT verb. |
LDClientConfigBuilder_DataSource_WithReasons | ( | LDClientConfigBuilder | b, |
bool | with_reasons | ||
) |
The additional information will then be available through the client's VariationDetail methods. Since this increases the size of network requests, such information is not sent unless you set this option to true.
b | Client config builder. Must not be NULL. |
with_reasons | True to enable reasons. |
LDClientConfigBuilder_Events_AllAttributesPrivate | ( | LDClientConfigBuilder | b, |
bool | all_attributes_private | ||
) |
Attribute privacy indicates whether or not attributes should be retained by LaunchDarkly after being sent upon initialization, and if attributes should later be sent in events.
Attribute privacy may be specified in 3 ways:
(1) To specify that all attributes should be considered private - not just those designated private on a per-context basis - call this method with true as the parameter.
(2) To specify that a specific set of attributes should be considered private - in addition to those designated private on a per-context basis
(3) To specify private attributes on a per-context basis, it is not necessary to call either of these methods, as the default behavior is to treat all attributes as non-private unless otherwise specified.
b | Client config builder. Must not be NULL. |
all_attributes_private | True for behavior of (1), false for default behavior of (2) or (3). |
LDClientConfigBuilder_Events_Capacity | ( | LDClientConfigBuilder | b, |
size_t | capacity | ||
) |
Sets the capacity of the event processor. When more events are generated within the processor's flush interval than this value, events will be dropped.
b | Client config builder. Must not be NULL. |
capacity | Event queue capacity. |
LDClientConfigBuilder_Events_Enabled | ( | LDClientConfigBuilder | b, |
bool | enabled | ||
) |
Specify if event-sending should be enabled or not. By default, events are enabled.
b | Client config builder. Must not be NULL. |
enabled | True to enable event-sending. |
LDClientConfigBuilder_Events_FlushIntervalMs | ( | LDClientConfigBuilder | b, |
unsigned int | milliseconds | ||
) |
Sets the flush interval of the event processor. The processor queues outgoing events based on the capacity parameter; these events are then delivered based on the flush interval.
b | Client config builder. Must not be NULL. |
milliseconds | Interval between automatic flushes. |
LDClientConfigBuilder_Events_PrivateAttribute | ( | LDClientConfigBuilder | b, |
char const * | attribute_reference | ||
) |
Specifies a single private attribute. May be called multiple times with additional private attributes.
b | Client config builder. Must not be NULL. |
attribute_reference | Attribute to mark private. |
LDClientConfigBuilder_Free | ( | LDClientConfigBuilder | builder | ) |
Frees the builder; only necessary if not calling Build.
builder | Builder to free. |
LDClientConfigBuilder_HttpProperties_Header | ( | LDClientConfigBuilder | b, |
char const * | key, | ||
char const * | value | ||
) |
Set a custom header value. May be called more than once with additional headers.
b | Client config builder. Must not be NULL. |
key | Name of the header. Must not be NULL. |
value | Value of the header. Must not be NULL. |
LDClientConfigBuilder_HttpProperties_Tls | ( | LDClientConfigBuilder | b, |
LDClientHttpPropertiesTlsBuilder | tls_builder | ||
) |
Sets the TLS options builder. The builder is consumed; do not free it.
b | Client config builder. Must not be NULL. |
tls_builder | The TLS options builder. Must not be NULL. |
LDClientConfigBuilder_HttpProperties_WrapperName | ( | LDClientConfigBuilder | b, |
char const * | wrapper_name | ||
) |
This should be used for wrapper SDKs to set the wrapper name.
Wrapper information will be included in request headers.
b | Client config builder. Must not be NULL. |
wrapper_name | Name of the wrapper. |
LDClientConfigBuilder_HttpProperties_WrapperVersion | ( | LDClientConfigBuilder | b, |
char const * | wrapper_version | ||
) |
This should be used for wrapper SDKs to set the wrapper version.
Wrapper information will be included in request headers.
b | Client config builder. Must not be NULL. |
wrapper_version | Version of the wrapper. |
LDClientConfigBuilder_Logging_Basic | ( | LDClientConfigBuilder | b, |
LDLoggingBasicBuilder | basic_builder | ||
) |
Configures the SDK with basic logging.
b | Client config builder. Must not be NULL. |
basic_builder | The basic logging builder. Must not be NULL. |
LDClientConfigBuilder_Logging_Custom | ( | LDClientConfigBuilder | b, |
LDLoggingCustomBuilder | custom_builder | ||
) |
Configures the SDK with custom logging.
b | Client config builder. Must not be NULL. |
custom_builder | The custom logging builder. Must not be NULL. |
LDClientConfigBuilder_Logging_Disable | ( | LDClientConfigBuilder | b | ) |
Disables the default SDK logging.
b | Client config builder. Must not be NULL. |
LDClientConfigBuilder_New | ( | char const * | sdk_key | ) |
Constructs a client-side config builder.
LDClientConfigBuilder_Offline | ( | LDClientConfigBuilder | b, |
bool | offline | ||
) |
Enables or disables "Offline" mode. True means Offline mode is enabled.
b | Client config builder. Must not be NULL. |
offline | True if offline. |
LDClientConfigBuilder_Persistence_Custom | ( | LDClientConfigBuilder | b, |
LDPersistenceCustomBuilder | custom_builder | ||
) |
Configures the SDK with custom persistence.
b | Client config builder. Must not be NULL. |
custom_builder | The custom persistence builder. Must not be NULL. |
LDClientConfigBuilder_Persistence_None | ( | LDClientConfigBuilder | b | ) |
Disables persistence.
b | Client config builder. Must not be NULL. |
LDClientConfigBuilder_ServiceEndpoints_EventsBaseURL | ( | LDClientConfigBuilder | b, |
char const * | url | ||
) |
Sets a custom URL for the events service.
b | Client config builder. Must not be NULL. |
url | Target URL. Must not be NULL. |
LDClientConfigBuilder_ServiceEndpoints_PollingBaseURL | ( | LDClientConfigBuilder | b, |
char const * | url | ||
) |
Sets a custom URL for the polling service.
b | Client config builder. Must not be NULL. |
url | Target URL. Must not be NULL. |
LDClientConfigBuilder_ServiceEndpoints_RelayProxyBaseURL | ( | LDClientConfigBuilder | b, |
char const * | url | ||
) |
Sets a custom URL for a Relay Proxy instance. The streaming, polling, and events URLs are set automatically.
b | Client config builder. Must not be NULL. |
url | Target URL. Must not be NULL. |
LDClientConfigBuilder_ServiceEndpoints_StreamingBaseURL | ( | LDClientConfigBuilder | b, |
char const * | url | ||
) |
Sets a custom URL for the streaming service.
b | Client config builder. Must not be NULL. |
url | Target URL. Must not be NULL. |
LDClientHttpPropertiesTlsBuilder_CustomCAFile | ( | LDClientHttpPropertiesTlsBuilder | b, |
char const * | custom_ca_file | ||
) |
Configures TLS peer certificate verification to use a custom CA file.
The parameter is a filepath pointing to a bundle of one or more PEM-encoded x509 certificates comprising the root of trust for the SDK's outbound connections.
By default, the SDK uses the system's CA bundle. Passing the empty string will unset any previously set path and revert to the system's CA bundle.
b | Client config builder. Must not be NULL. |
custom_ca_file | Filepath of the custom CA bundle, or empty string. Must not be NULL. |
LDClientHttpPropertiesTlsBuilder_Free | ( | LDClientHttpPropertiesTlsBuilder | b | ) |
Frees a TLS options builder. Do not call if the builder was consumed by the HttpProperties builder.
b | Builder to free. |
LDClientHttpPropertiesTlsBuilder_New | ( | void | ) |
Creates a new TLS options builder for the HttpProperties builder.
If not passed into the HttpProperties builder, must be manually freed with LDClientHttpPropertiesTlsBuilder_Free.
LDClientHttpPropertiesTlsBuilder_SkipVerifyPeer | ( | LDClientHttpPropertiesTlsBuilder | b, |
bool | skip_verify_peer | ||
) |
Configures TLS peer certificate verification. Peer verification is enabled by default.
Disabling peer verification is not recommended unless a specific use-case calls for it.
b | Client config builder. Must not be NULL. |
skip_verify_peer | True to skip verification. |
LDDataSourcePollBuilder_Free | ( | LDDataSourcePollBuilder | b | ) |
Frees a Polling method builder. Do not call if the builder was consumed by the config builder.
b | Builder to free. |
LDDataSourcePollBuilder_IntervalS | ( | LDDataSourcePollBuilder | b, |
unsigned int | seconds | ||
) |
Sets the interval at which the SDK will poll for feature flag updates.
b | Polling method builder. Must not be NULL. |
milliseconds | Polling interval. |
LDDataSourcePollBuilder_New | ( | ) |
Creates a new DataSource builder for the Polling method.
If not passed into the config builder, must be manually freed with LDDataSourcePollBuilder_Free.
LDDataSourceStreamBuilder_Free | ( | LDDataSourceStreamBuilder | b | ) |
Frees a Streaming method builder. Do not call if the builder was consumed by the config builder.
b | Builder to free. |
LDDataSourceStreamBuilder_InitialReconnectDelayMs | ( | LDDataSourceStreamBuilder | b, |
unsigned int | milliseconds | ||
) |
Sets the initial reconnect delay for the streaming connection.
The streaming service uses a backoff algorithm (with jitter) every time the connection needs to be reestablished.The delay for the first reconnection will start near this value, and then increase exponentially for any subsequent connection failures.
b | Streaming method builder. Must not be NULL. |
milliseconds | Initial delay for a reconnection attempt. |
LDDataSourceStreamBuilder_New | ( | ) |
Creates a new DataSource builder for the Streaming method.
If not passed into the config builder, must be manually freed with LDDataSourceStreamBuilder_Free.
LDPersistence_Init | ( | struct LDPersistence * | implementation | ) |
Initializes a custom persistence implementation. Must be called before passing a custom implementation into configuration.
backend | Implementation to initialize. |
LDPersistenceCustomBuilder_Free | ( | LDPersistenceCustomBuilder | b | ) |
Frees a custom persistence builder. Do not call if the builder was consumed by the config builder.
b | Builder to free. |
LDPersistenceCustomBuilder_Implementation | ( | LDPersistenceCustomBuilder | b, |
struct LDPersistence | impl | ||
) |
Sets a custom persistence implementation.
b | Custom persistence builder. Must not be NULL. |
impl | The implementation to use for persistence. Ensure the implementation was initialized with LDPersistence_Init. |
LDPersistenceCustomBuilder_New | ( | ) |
Creates a new builder for a custom, user-provided persistence.
If not passed into the config builder, must be manually freed with LDPersistenceCustomBuilder_Free.