flipt_client 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ext/darwin_arm64/libfliptengine.dylib +0 -0
- data/lib/ext/darwin_arm64/libfliptengine.rlib +0 -0
- data/lib/ext/linux_arm64/libfliptengine.rlib +0 -0
- data/lib/ext/linux_arm64/libfliptengine.so +0 -0
- data/lib/ext/linux_x86_64/flipt_engine.h +7 -0
- data/lib/ext/linux_x86_64/libfliptengine.rlib +0 -0
- data/lib/ext/linux_x86_64/libfliptengine.so +0 -0
- data/lib/flipt_client/version.rb +1 -1
- data/lib/flipt_client.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9950fd63fded6faea31f9571eb54e5b5af3d0be5a452de37871432c6a1c2c4ee
|
4
|
+
data.tar.gz: df2abf9e11373d0bae1fc2d56e246197977eb7c029185a2c2c96a33c7325dd80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd403f5d9a0d15d4450cbddb787e3660bf130ded83122a50de68bd448db8c053f8da948170ab9fff7027fad18640cbbfc280cb4017647c70980258238adb3ba0
|
7
|
+
data.tar.gz: ae128e7881eea794d7629fc5400e75ad8c63c0114d38e61e57643400850accc59f6a15316e320f0f82136be76afee1c0da609b397baadaa1b6a762d25c28e27b
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -24,6 +24,13 @@ const char *evaluate_variant(void *engine_ptr, const char *evaluation_request);
|
|
24
24
|
*/
|
25
25
|
const char *evaluate_boolean(void *engine_ptr, const char *evaluation_request);
|
26
26
|
|
27
|
+
/**
|
28
|
+
* # Safety
|
29
|
+
*
|
30
|
+
* This function will take in a pointer to the engine and return a batch evaluation response.
|
31
|
+
*/
|
32
|
+
const char *evaluate_batch(void *engine_ptr, const char *batch_evaluation_request);
|
33
|
+
|
27
34
|
/**
|
28
35
|
* # Safety
|
29
36
|
*
|
Binary file
|
Binary file
|
data/lib/flipt_client/version.rb
CHANGED
data/lib/flipt_client.rb
CHANGED
@@ -36,6 +36,8 @@ module Flipt
|
|
36
36
|
attach_function :evaluate_variant, %i[pointer string], :string
|
37
37
|
# const char *evaluate_boolean(void *engine_ptr, const char *evaluation_request);
|
38
38
|
attach_function :evaluate_boolean, %i[pointer string], :string
|
39
|
+
# const char *evaluate_batch(void *engine_ptr, const char *batch_evaluation_request);
|
40
|
+
attach_function :evaluate_batch, %i[pointer string], :string
|
39
41
|
|
40
42
|
# Create a new Flipt client
|
41
43
|
#
|
@@ -93,6 +95,22 @@ module Flipt
|
|
93
95
|
resp = self.class.evaluate_boolean(@engine, evaluation_request.to_json)
|
94
96
|
JSON.parse(resp)
|
95
97
|
end
|
98
|
+
|
99
|
+
# Evaluate a batch of flags for a given request
|
100
|
+
#
|
101
|
+
# @param batch_evaluation_request [Array<Hash>] batch evaluation request
|
102
|
+
# - :entity_id [String] entity id
|
103
|
+
# - :flag_key [String] flag key
|
104
|
+
# - :namespace_key [String] override namespace key
|
105
|
+
def evaluate_batch(batch_evaluation_request = [])
|
106
|
+
for request in batch_evaluation_request do
|
107
|
+
request[:namespace_key] = @namespace
|
108
|
+
validate_evaluation_request(request)
|
109
|
+
end
|
110
|
+
|
111
|
+
resp = self.class.evaluate_batch(@engine, batch_evaluation_request.to_json)
|
112
|
+
JSON.parse(resp)
|
113
|
+
end
|
96
114
|
|
97
115
|
private
|
98
116
|
def validate_evaluation_request(evaluation_request)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipt_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flipt Devs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Flipt Client Evaluation SDK
|
14
14
|
email:
|