Skip to content

Commit 1990188

Browse files
committed
refactor
1 parent a7cf886 commit 1990188

9 files changed

Lines changed: 1385 additions & 534 deletions

File tree

Cargo.lock

Lines changed: 1111 additions & 150 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components-rs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ libdd-telemetry-ffi = { path = "../libdatadog/libdd-telemetry-ffi", default-feat
1515
datadog-live-debugger = { path = "../libdatadog/datadog-live-debugger" }
1616
datadog-live-debugger-ffi = { path = "../libdatadog/datadog-live-debugger-ffi", default-features = false }
1717
datadog-ipc = { path = "../libdatadog/datadog-ipc" }
18-
datadog-remote-config = { path = "../libdatadog/datadog-remote-config" }
18+
datadog-remote-config = { path = "../libdatadog/datadog-remote-config", features = ["ffe"] }
1919
datadog-sidecar = { path = "../libdatadog/datadog-sidecar" }
2020
datadog-sidecar-ffi = { path = "../libdatadog/datadog-sidecar-ffi" }
2121
libdd-tinybytes = { path = "../libdatadog/libdd-tinybytes" }

components-rs/ddtrace.h

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,43 +66,34 @@ const char *ddog_remote_config_get_path(const struct ddog_RemoteConfigState *rem
6666

6767
bool ddog_process_remote_configs(struct ddog_RemoteConfigState *remote_config);
6868

69-
uint8_t *ddog_get_ffe_config(size_t *out_len);
70-
71-
void ddog_free_ffe_config(uint8_t *ptr, size_t len);
69+
bool ddog_ffe_has_config(void);
7270

7371
bool ddog_ffe_config_changed(void);
7472

75-
bool ddog_ffe_load_config(const uint8_t *data, size_t len);
76-
77-
void ddog_ffe_clear_config(void);
78-
79-
bool ddog_ffe_has_config(void);
73+
struct FfeResult;
8074

81-
struct ddog_FfeResolutionDetails;
75+
struct FfeAttribute {
76+
const char *key;
77+
int32_t value_type; /* 0=string, 1=number, 2=bool */
78+
const char *string_value;
79+
double number_value;
80+
bool bool_value;
81+
};
8282

83-
struct ddog_FfeResolutionDetails *ddog_ffe_evaluate(
83+
struct FfeResult *ddog_ffe_evaluate(
8484
const char *flag_key,
8585
int32_t expected_type,
86-
const uint8_t *context_json,
87-
size_t context_json_len);
88-
89-
const char *ddog_ffe_result_value(const struct ddog_FfeResolutionDetails *details);
90-
91-
const char *ddog_ffe_result_variant(const struct ddog_FfeResolutionDetails *details);
92-
93-
const char *ddog_ffe_result_allocation_key(const struct ddog_FfeResolutionDetails *details);
94-
95-
int32_t ddog_ffe_result_reason(const struct ddog_FfeResolutionDetails *details);
96-
97-
int32_t ddog_ffe_result_error_code(const struct ddog_FfeResolutionDetails *details);
98-
99-
const char *ddog_ffe_result_error_message(const struct ddog_FfeResolutionDetails *details);
100-
101-
bool ddog_ffe_result_do_log(const struct ddog_FfeResolutionDetails *details);
102-
103-
void ddog_ffe_free_result(struct ddog_FfeResolutionDetails *details);
104-
105-
bool ddog_ffe_config_changed(void);
86+
const char *targeting_key,
87+
const struct FfeAttribute *attributes,
88+
size_t attributes_count);
89+
90+
const char *ddog_ffe_result_value(const struct FfeResult *r);
91+
const char *ddog_ffe_result_variant(const struct FfeResult *r);
92+
const char *ddog_ffe_result_allocation_key(const struct FfeResult *r);
93+
int32_t ddog_ffe_result_reason(const struct FfeResult *r);
94+
int32_t ddog_ffe_result_error_code(const struct FfeResult *r);
95+
bool ddog_ffe_result_do_log(const struct FfeResult *r);
96+
void ddog_ffe_free_result(struct FfeResult *r);
10697

10798
bool ddog_type_can_be_instrumented(const struct ddog_RemoteConfigState *remote_config,
10899
ddog_CharSlice typename_);

0 commit comments

Comments
 (0)