flipt_client 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cbfce772261a0e968cbcc2b0135b851e86dda4107abe8cac583a2c2cb23692c
4
- data.tar.gz: ae3cad47961fabefe5abd90310a3f91a3e57d35dbd976e98b0a82939bfd988b3
3
+ metadata.gz: e8bc0c05bef4e63e44af80fc645966860d85d2d67955d286395b86db656813e7
4
+ data.tar.gz: bc31ef92a86f73ae137e187a5fb3a99720ac18de2ccb64da0c2a1b562f886a43
5
5
  SHA512:
6
- metadata.gz: edb56a32998775cc00ff7cbc54302978e40a1f0eae8f16b15684a872d3f713b73652e924391556d6a2683a2483059a8421cb98603bc724723dc9d095813deb61
7
- data.tar.gz: 7d684bead44f7d8eae6091f46dfcfe1bcdb8d391cdaad9796f398ab96b902e71d7a04e87678d66c5fc7df215796620a069be770d764c05e1d2f6234ca911a16f
6
+ metadata.gz: fd61d88defa40b66c686f1fa14b6df9bb1b578c2dc1a2e8aedc5d218c241fe9678b98002d5873cb50d0d413e46dd333ea3549e4f6bf1dd6c50a3c7699478bfa6
7
+ data.tar.gz: 4d8a6c9413564d3fa631541f05fc72dba7bad3d1bacf5b43995e61803b010e7f9517f11a1b3a231ca5fbe9b5fbd06bf47969bc55423003b5af7ff992021130a7
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flipt
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.0
4
+ version: 0.2.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-01-25 00:00:00.000000000 Z
11
+ date: 2024-02-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Flipt Client Evaluation SDK
14
14
  email: