NAME
LaunchDarkly::Server - Perl server side SDK for LaunchDarkly
SYNOPSIS
use LaunchDarkly::Server;
my $config = LaunchDarkly::Server::LDConfigNew("my-sdk-key");
my $timeout = 10000;
my $debug = 0;
my $default = 0;
my $client = LaunchDarkly::Server::LDClientInit($config, $timeout);
my $user = LaunchDarkly::Server::LDUserNew("user123");
my result = LaunchDarkly::Server::LDBoolVariation($client, $user, "my-very-new-feature", $default, $debug);
print LaunchDarkly::Server::LDDetailsToString() unless not $debug;
LaunchDarkly::Server::LDUserFree($user);
LaunchDarkly::Server::LDClientClose($client);
DESCRIPTION
See https://docs.launchdarkly.com/sdk/server-side/c-c--
EXPORT
None by default.
Exportable constants
LD_CLIENT_NOT_READY
LD_CLIENT_NOT_SPECIFIED
LD_ERROR
LD_FALLTHROUGH
LD_FLAG_NOT_FOUND
LD_LOG_CRITICAL
LD_LOG_DEBUG
LD_LOG_ERROR
LD_LOG_FATAL
LD_LOG_INFO
LD_LOG_TRACE
LD_LOG_WARNING
LD_MALFORMED_FLAG
LD_NULL_KEY
LD_OFF
LD_OOM
LD_PREREQUISITE_FAILED
LD_RULE_MATCH
LD_STORE_ERROR
LD_TARGET_MATCH
LD_UNKNOWN
LD_USER_NOT_SPECIFIED
LD_WRONG_TYPE
Exportable functions
void
LDSetLogLevel(int level)
struct LDJSON *
LDAllFlags(struct LDClient *const client, const struct LDUser *const user)
struct LDAllFlagsState *
LDAllFlagsState(struct LDClient *const client, const struct LDUser *const user, unsigned int options)
void
LDAllFlagsStateFree(struct LDAllFlagsState *flags)
struct LDDetails*
LDAllFlagsStateGetDetails(struct LDAllFlagsState* flags, const char* key)
struct LDJSON*
LDAllFlagsStateGetValue(struct LDAllFlagsState* flags, const char* key)
char*
LDAllFlagsStateSerializeJSON(struct LDAllFlagsState *flags)
struct LDJSON*
LDAllFlagsStateToValuesMap(struct LDAllFlagsState* flags)
LDBoolean
LDAllFlagsStateValid(struct LDAllFlagsState *flags)
LDBoolean
LDArrayAppend(struct LDJSON *const prefix, const struct LDJSON *const suffix)
struct LDJSON *
LDArrayLookup(const struct LDJSON *const array, const unsigned int index)
LDBoolean
LDArrayPush(struct LDJSON *const array, struct LDJSON *const item)
LDBoolean
LDBoolVariation(
struct LDClient *const client,
const struct LDUser *const user,
const char *const key,
const LDBoolean fallback,
bool getDetails)
LDBoolean
LDClientAlias(
struct LDClient *const client,
const struct LDUser *const currentUser,
const struct LDUser *const previousUser)
LDBoolean
LDClientClose(struct LDClient *const client)
LDBoolean
LDClientFlush(struct LDClient *const client)
LDBoolean
LDClientIdentify(
struct LDClient *const client, const struct LDUser *const user)
LDClientInit(struct LDConfig *const config, const unsigned int maxwaitmilli)
LDBoolean
LDClientIsInitialized(struct LDClient *const client)
LDBoolean
LDClientIsOffline(struct LDClient *const client)
LDClientTrack(
struct LDClient *const client,
const char *const key,
const struct LDUser *const user,
struct LDJSON *const data)
LDClientTrackMetric(
struct LDClient *const client,
const char *const key,
const struct LDUser *const user,
struct LDJSON *const data,
const double metric)
LDCollectionDetachIter(
struct LDJSON *const collection, struct LDJSON *const iter)
unsigned int
LDCollectionGetSize(const struct LDJSON *const collection)
LDBoolean
LDConfigAddPrivateAttribute(
struct LDConfig *const config, const char *const attribute)
void
LDConfigFree(struct LDConfig *const config)
void
LDConfigInlineUsersInEvents(
struct LDConfig *const config, const LDBoolean inlineUsersInEvents)
struct LDConfig *
LDConfigNew(const char *const key)
void
LDConfigSetAllAttributesPrivate(
struct LDConfig *const config, const LDBoolean allAttributesPrivate)
LDBoolean
LDConfigSetBaseURI(struct LDConfig *const config, const char *const baseURI)
void
LDConfigSetEventsCapacity(
struct LDConfig *const config, const unsigned int eventsCapacity)
LDBoolean
LDConfigSetEventsURI(
struct LDConfig *const config, const char *const eventsURI)
void
LDConfigSetFeatureStoreBackend(
struct LDConfig *const config, struct LDStoreInterface *const backend)
void
LDConfigSetFeatureStoreBackendCacheTTL(
struct LDConfig *const config, const unsigned int milliseconds)
void
LDConfigSetFlushInterval(
struct LDConfig *const config, const unsigned int milliseconds)
void
LDConfigSetOffline(struct LDConfig *const config, const LDBoolean offline)
void
LDConfigSetPollInterval(
struct LDConfig *const config, const unsigned int milliseconds)
void
LDConfigSetSendEvents(
struct LDConfig *const config, const LDBoolean sendEvents)
void
LDConfigSetStream(struct LDConfig *const config, const LDBoolean stream)
LDBoolean
LDConfigSetStreamURI(
struct LDConfig *const config, const char *const streamURI)
void
LDConfigSetTimeout(
struct LDConfig *const config, const unsigned int milliseconds)
void
LDConfigSetUseLDD(struct LDConfig *const config, const LDBoolean useLDD)
void
LDConfigSetUserKeysCapacity(
struct LDConfig *const config, const unsigned int userKeysCapacity)
void
LDConfigSetUserKeysFlushInterval(
struct LDConfig *const config, const unsigned int milliseconds)
LDBoolean
LDConfigSetWrapperInfo(
struct LDConfig *const config,
const char *const wrapperName,
const char *const wrapperVersion)
void LDDetailsClear(struct LDDetails *const details)
void LDDetailsInit(struct LDDetails *const details)
double
LDDoubleVariation(
struct LDClient *const client,
const struct LDUser *const user,
const char *const key,
const double fallback,
bool getDetails)
const char *
LDEvalErrorKindToString(const enum LDEvalErrorKind kind)
const char * LDEvalReasonKindToString(const enum LDEvalReason kind)
LDBoolean LDGetBool(const struct LDJSON *const node)
LDBoolean LDGetBool(const struct LDJSON *const node)
struct LDJSON * LDGetIter(const struct LDJSON *const collection)
struct LDJSON * LDGetIter(const struct LDJSON *const collection)
double LDGetNumber(const struct LDJSON *const node)
double LDGetNumber(const struct LDJSON *const node)
const char * LDGetText(const struct LDJSON *const node)
const char * LDGetText(const struct LDJSON *const node)
int
LDIntVariation(
struct LDClient *const client,
const struct LDUser *const user,
const char *const key,
const int fallback,
bool getDetails)
const char *
LDIterKey(const struct LDJSON *const iter)
struct LDJSON *
LDIterNext(const struct LDJSON *const iter)
LDBoolean
LDJSONCompare(
const struct LDJSON *const left, const struct LDJSON *const right)
struct LDJSON *
LDJSONDeserialize(const char *const text)
struct LDJSON *
LDJSONDuplicate(const struct LDJSON *const json)
void
LDJSONFree(struct LDJSON *const json)
LDJSONType
LDJSONGetType(const struct LDJSON *const json)
char *
LDJSONSerialize(const struct LDJSON *const json)
struct LDJSON *
LDJSONVariation(
struct LDClient *const client,
const struct LDUser *const user,
const char *const key,
const struct LDJSON *const fallback,
bool getDetails)
struct LDJSON *
LDNewArray(void)
struct LDJSON *
LDNewBool(const LDBoolean boolean)
struct LDJSON *
LDNewNull(void)
struct LDJSON *
LDNewNumber(const double number)
struct LDJSON *
LDNewObject(void)
struct LDJSON *
LDNewText(const char *const text)
void
LDObjectDeleteKey(struct LDJSON *const object, const char *const key)
struct LDJSON *
LDObjectDetachKey(struct LDJSON *const object, const char *const key)
struct LDJSON *
LDObjectLookup(const struct LDJSON *const object, const char *const key)
LDBoolean
LDObjectMerge(struct LDJSON *const to, const struct LDJSON *const from)
LDBoolean
LDObjectSetKey(
struct LDJSON *const object,
const char *const key,
struct LDJSON *const item)
struct LDJSON *
LDReasonToJSON(const struct LDDetails *const details)
LDBoolean
LDSetNumber(struct LDJSON *const node, const double number)
char *
LDStringVariation(
struct LDClient *const client,
const struct LDUser *const user,
const char *const key,
const char *const fallback,
bool getDetails)
LDBoolean
LDUserAddPrivateAttribute(
struct LDUser *const user, const char *const attribute)
void
LDUserFree(struct LDUser *const user)
struct LDUser *
LDUserNew(const char *const key)
void
LDUserSetAnonymous(struct LDUser *const user, const LDBoolean anon)
LDBoolean
LDUserSetAvatar(struct LDUser *const user, const char *const avatar)
LDBoolean
LDUserSetCountry(struct LDUser *const user, const char *const country)
void
LDUserSetCustom(struct LDUser *const user, struct LDJSON *const custom)
void
LDUserSetCustomAttributesJSON(
struct LDUser *const user, struct LDJSON *const custom)
LDBoolean
LDUserSetEmail(struct LDUser *const user, const char *const email)
LDBoolean
LDUserSetFirstName(struct LDUser *const user, const char *const firstName)
LDBoolean
LDUserSetIP(struct LDUser *const user, const char *const ip)
LDBoolean
LDUserSetLastName(struct LDUser *const user, const char *const lastName)
LDBoolean
LDUserSetName(struct LDUser *const user, const char *const name)
void
LDUserSetPrivateAttributes(
struct LDUser *const user, struct LDJSON *const privateAttributes)
LDBoolean
LDUserSetSecondary(struct LDUser *const user, const char *const secondary)
SEE ALSO
AUTHOR
Miklos Tirpak, <miklos.tirpak@emnify.com>
COPYRIGHT AND LICENSE
Copyright (C) 2022 by EMnify
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.32.1 or, at your option, any later version of Perl 5 you may have available.