eppo-server-sdk 3.5.1-aarch64-linux-musl → 3.7.0-aarch64-linux-musl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eppo_client/3.0/eppo_client.so +0 -0
- data/lib/eppo_client/3.1/eppo_client.so +0 -0
- data/lib/eppo_client/3.2/eppo_client.so +0 -0
- data/lib/eppo_client/3.3/eppo_client.so +0 -0
- data/lib/eppo_client/client.rb +162 -3
- data/lib/eppo_client/version.rb +1 -1
- data/lib/eppo_client.rb +8 -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: d2b12ba3a16c344cb94c6603cf687b8142b1b5104511f856d584615fd2e34fbd
|
4
|
+
data.tar.gz: c66093838020f9eaf1ef68502a640a62255019dc58dbe560d927eaffd4384070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eb96240cd52815e8b903e58182fc29b5dafee3ce5512e7b5583893e6a3157c85313e0af9aa34dde69dd9c23f125971d5d0d39173f9ccb74f3102d26dc3c42c4
|
7
|
+
data.tar.gz: 2612376e28b9430593a1c06db623678a64c418a818a60fb6777046551af8e0df7caf1c2791c16b06aeb7767b95cf2f29624bb0ef35a4f7f1206af9d2cc13ec05
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/eppo_client/client.rb
CHANGED
@@ -31,64 +31,210 @@ module EppoClient
|
|
31
31
|
@core = EppoClient::Core::Client.new(config)
|
32
32
|
end
|
33
33
|
|
34
|
+
##
|
35
|
+
# Waits for client to fetch configuration and get ready to serve
|
36
|
+
# assignments.
|
37
|
+
#
|
38
|
+
# This method blocks the current thread until configuration is
|
39
|
+
# successfully fetched or +timeout+ seconds passed.
|
40
|
+
#
|
41
|
+
# Note: this method returns immediately if configuration poller
|
42
|
+
# has been disabled.
|
43
|
+
#
|
44
|
+
# @param timeout [Numeric] Maximum time to wait in seconds
|
45
|
+
# @return [nil]
|
46
|
+
def wait_for_initialization(timeout=1)
|
47
|
+
return unless @core
|
48
|
+
@core.wait_for_initialization(timeout)
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# Returns the currently active configuration.
|
34
53
|
def configuration
|
35
54
|
@core.configuration
|
36
55
|
end
|
37
56
|
|
57
|
+
##
|
58
|
+
# Sets the currently active configuration.
|
38
59
|
def configuration=(configuration)
|
39
60
|
@core.configuration = configuration
|
40
61
|
end
|
41
62
|
|
63
|
+
##
|
64
|
+
# Prepare the client for shutdown.
|
65
|
+
#
|
66
|
+
# This method stops the configuration poller and any other background threads.
|
67
|
+
#
|
68
|
+
# @return [nil]
|
42
69
|
def shutdown
|
43
70
|
@core.shutdown
|
44
71
|
end
|
45
72
|
|
46
|
-
|
47
|
-
#
|
73
|
+
##
|
74
|
+
# Tracks an arbitrary event. Events must have a type and a payload.
|
75
|
+
#
|
76
|
+
# @note This method is considered unstable and may change in future versions.
|
77
|
+
#
|
78
|
+
# @param event_type [String] The type of the event to track.
|
79
|
+
# @param payload [Hash] The payload of the event to track.
|
48
80
|
def unstable_track(event_type, payload)
|
49
81
|
@core.track(event_type, payload)
|
50
82
|
end
|
51
83
|
|
84
|
+
##
|
85
|
+
# Returns a string assignment for the given flag key and subject.
|
86
|
+
#
|
87
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
88
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
89
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
90
|
+
# @param default_value [String] The default value to return if the flag is not found or no assignment can be made.
|
91
|
+
# @return [String] The assignment for the given flag key and subject.
|
52
92
|
def get_string_assignment(flag_key, subject_key, subject_attributes, default_value)
|
53
93
|
get_assignment_inner(flag_key, subject_key, subject_attributes, "STRING", default_value)
|
54
94
|
end
|
55
95
|
|
96
|
+
##
|
97
|
+
# Returns a numeric assignment for the given flag key and subject.
|
98
|
+
#
|
99
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
100
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
101
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
102
|
+
# @param default_value [Numeric] The default value to return if the flag is not found or no assignment can be made.
|
103
|
+
# @return [Numeric] The assignment for the given flag key and subject.
|
56
104
|
def get_numeric_assignment(flag_key, subject_key, subject_attributes, default_value)
|
57
105
|
get_assignment_inner(flag_key, subject_key, subject_attributes, "NUMERIC", default_value)
|
58
106
|
end
|
59
107
|
|
108
|
+
##
|
109
|
+
# Returns an integer assignment for the given flag key and subject.
|
110
|
+
#
|
111
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
112
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
113
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
114
|
+
# @param default_value [Integer] The default value to return if the flag is not found or no assignment can be made.
|
115
|
+
# @return [Integer] The assignment for the given flag key and subject.
|
60
116
|
def get_integer_assignment(flag_key, subject_key, subject_attributes, default_value)
|
61
117
|
get_assignment_inner(flag_key, subject_key, subject_attributes, "INTEGER", default_value)
|
62
118
|
end
|
63
119
|
|
120
|
+
##
|
121
|
+
# Returns a boolean assignment for the given flag key and subject.
|
122
|
+
#
|
123
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
124
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
125
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
126
|
+
# @param default_value [Boolean] The default value to return if the flag is not found or no assignment can be made.
|
127
|
+
# @return [Boolean] The assignment for the given flag key and subject.
|
64
128
|
def get_boolean_assignment(flag_key, subject_key, subject_attributes, default_value)
|
65
129
|
get_assignment_inner(flag_key, subject_key, subject_attributes, "BOOLEAN", default_value)
|
66
130
|
end
|
67
131
|
|
132
|
+
##
|
133
|
+
# Returns a JSON assignment for the given flag key and subject.
|
134
|
+
#
|
135
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
136
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
137
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
138
|
+
# @param default_value [Hash] The default value to return if the flag is not found or no assignment can be made.
|
139
|
+
# @return [Hash] The assignment for the given flag key and subject.
|
68
140
|
def get_json_assignment(flag_key, subject_key, subject_attributes, default_value)
|
69
141
|
get_assignment_inner(flag_key, subject_key, subject_attributes, "JSON", default_value)
|
70
142
|
end
|
71
143
|
|
144
|
+
##
|
145
|
+
# Returns detailed information about a string assignment for the given flag key and subject.
|
146
|
+
#
|
147
|
+
# @note This method is intended for debugging purposes and is discouraged from use in
|
148
|
+
# production. It is a couple of times slower than the non-detail methods. The evaluation
|
149
|
+
# details format is primarily designed for human consumption (debugging) and is therefore
|
150
|
+
# unstable and may change between SDK versions.
|
151
|
+
#
|
152
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
153
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
154
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
155
|
+
# @param default_value [String] The default value to return if the flag is not found or no assignment can be made.
|
156
|
+
# @return [Hash] A hash containing {:variation => assigned_value, :action => nil, :evaluationDetails => {detailed_evaluation_info}}
|
72
157
|
def get_string_assignment_details(flag_key, subject_key, subject_attributes, default_value)
|
73
158
|
get_assignment_details_inner(flag_key, subject_key, subject_attributes, "STRING", default_value)
|
74
159
|
end
|
75
160
|
|
161
|
+
##
|
162
|
+
# Returns detailed information about a numeric assignment for the given flag key and subject.
|
163
|
+
#
|
164
|
+
# @note This method is intended for debugging purposes and is discouraged from use in
|
165
|
+
# production. It is a couple of times slower than the non-detail methods. The evaluation
|
166
|
+
# details format is primarily designed for human consumption (debugging) and is therefore
|
167
|
+
# unstable.
|
168
|
+
#
|
169
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
170
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
171
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
172
|
+
# @param default_value [Numeric] The default value to return if the flag is not found or no assignment can be made.
|
173
|
+
# @return [Hash] A hash containing {:variation => assigned_value, :action => nil, :evaluationDetails => {detailed_evaluation_info}}
|
76
174
|
def get_numeric_assignment_details(flag_key, subject_key, subject_attributes, default_value)
|
77
175
|
get_assignment_details_inner(flag_key, subject_key, subject_attributes, "NUMERIC", default_value)
|
78
176
|
end
|
79
177
|
|
178
|
+
##
|
179
|
+
# Returns detailed information about an integer assignment for the given flag key and subject.
|
180
|
+
#
|
181
|
+
# @note This method is intended for debugging purposes and is discouraged from use in
|
182
|
+
# production. It is a couple of times slower than the non-detail methods. The evaluation
|
183
|
+
# details format is primarily designed for human consumption (debugging) and is therefore
|
184
|
+
# unstable and may change between SDK versions.
|
185
|
+
#
|
186
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
187
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
188
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
189
|
+
# @param default_value [Integer] The default value to return if the flag is not found or no assignment can be made.
|
190
|
+
# @return [Hash] A hash containing {:variation => assigned_value, :action => nil, :evaluationDetails => {detailed_evaluation_info}}
|
80
191
|
def get_integer_assignment_details(flag_key, subject_key, subject_attributes, default_value)
|
81
192
|
get_assignment_details_inner(flag_key, subject_key, subject_attributes, "INTEGER", default_value)
|
82
193
|
end
|
83
194
|
|
195
|
+
##
|
196
|
+
# Returns detailed information about a boolean assignment for the given flag key and subject.
|
197
|
+
#
|
198
|
+
# @note This method is intended for debugging purposes and is discouraged from use in
|
199
|
+
# production. It is a couple of times slower than the non-detail methods. The evaluation
|
200
|
+
# details format is primarily designed for human consumption (debugging) and is therefore
|
201
|
+
# unstable and may change between SDK versions.
|
202
|
+
#
|
203
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
204
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
205
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
206
|
+
# @param default_value [Boolean] The default value to return if the flag is not found or no assignment can be made.
|
207
|
+
# @return [Hash] A hash containing {:variation => assigned_value, :action => nil, :evaluationDetails => {detailed_evaluation_info}}
|
84
208
|
def get_boolean_assignment_details(flag_key, subject_key, subject_attributes, default_value)
|
85
209
|
get_assignment_details_inner(flag_key, subject_key, subject_attributes, "BOOLEAN", default_value)
|
86
210
|
end
|
87
211
|
|
212
|
+
##
|
213
|
+
# Returns detailed information about a JSON assignment for the given flag key and subject.
|
214
|
+
#
|
215
|
+
# @note This method is intended for debugging purposes and is discouraged from use in
|
216
|
+
# production. It is a couple of times slower than the non-detail methods. The evaluation
|
217
|
+
# details format is primarily designed for human consumption (debugging) and is therefore
|
218
|
+
# unstable and may change between SDK versions.
|
219
|
+
#
|
220
|
+
# @param flag_key [String] The key of the flag to get an assignment for.
|
221
|
+
# @param subject_key [String] The key of the subject to get an assignment for.
|
222
|
+
# @param subject_attributes [Hash] The attributes of the subject to get an assignment for.
|
223
|
+
# @param default_value [Hash] The default value to return if the flag is not found or no assignment can be made.
|
224
|
+
# @return [Hash] A hash containing {:variation => assigned_value, :action => nil, :evaluationDetails => {detailed_evaluation_info}}
|
88
225
|
def get_json_assignment_details(flag_key, subject_key, subject_attributes, default_value)
|
89
226
|
get_assignment_details_inner(flag_key, subject_key, subject_attributes, "JSON", default_value)
|
90
227
|
end
|
91
228
|
|
229
|
+
##
|
230
|
+
# Returns a bandit action based on the flag key, subject, and available actions.
|
231
|
+
#
|
232
|
+
# @param flag_key [String] The key of the flag to get an action for.
|
233
|
+
# @param subject_key [String] The key of the subject to get an action for.
|
234
|
+
# @param subject_attributes [Hash] The attributes of the subject.
|
235
|
+
# @param actions [Hash] A map of available actions and their attributes.
|
236
|
+
# @param default_variation [String] The default variation to return if no assignment can be made.
|
237
|
+
# @return [Hash] A hash containing the assigned variation and action.
|
92
238
|
def get_bandit_action(flag_key, subject_key, subject_attributes, actions, default_variation)
|
93
239
|
attributes = coerce_context_attributes(subject_attributes)
|
94
240
|
actions = actions.to_h { |action, attributes| [action, coerce_context_attributes(attributes)] }
|
@@ -103,6 +249,20 @@ module EppoClient
|
|
103
249
|
}
|
104
250
|
end
|
105
251
|
|
252
|
+
##
|
253
|
+
# Returns detailed information about a bandit action based on the flag key, subject, and available actions.
|
254
|
+
#
|
255
|
+
# @note This method is intended for debugging purposes and is discouraged from use in
|
256
|
+
# production. It is a couple of times slower than the non-detail methods. The evaluation
|
257
|
+
# details format is primarily designed for human consumption (debugging) and is therefore
|
258
|
+
# unstable and may change between SDK versions.
|
259
|
+
#
|
260
|
+
# @param flag_key [String] The key of the flag to get an action for.
|
261
|
+
# @param subject_key [String] The key of the subject to get an action for.
|
262
|
+
# @param subject_attributes [Hash] The attributes of the subject.
|
263
|
+
# @param actions [Hash] A map of available actions and their attributes.
|
264
|
+
# @param default_variation [String] The default variation to return if no assignment can be made.
|
265
|
+
# @return [Hash] A hash containing {:variation => assigned_variation, :action => assigned_action, :evaluationDetails => {detailed_evaluation_info}}
|
106
266
|
def get_bandit_action_details(flag_key, subject_key, subject_attributes, actions, default_variation)
|
107
267
|
attributes = coerce_context_attributes(subject_attributes)
|
108
268
|
actions = actions.to_h { |action, attributes| [action, coerce_context_attributes(attributes)] }
|
@@ -120,7 +280,6 @@ module EppoClient
|
|
120
280
|
|
121
281
|
private
|
122
282
|
|
123
|
-
# rubocop:disable Metrics/MethodLength
|
124
283
|
def get_assignment_inner(flag_key, subject_key, subject_attributes, expected_type, default_value)
|
125
284
|
logger = Logger.new($stdout)
|
126
285
|
begin
|
data/lib/eppo_client/version.rb
CHANGED
data/lib/eppo_client.rb
CHANGED
@@ -6,6 +6,14 @@ require_relative "eppo_client/version"
|
|
6
6
|
# EppoClient is the main module for initializing the Eppo client.
|
7
7
|
# It provides a method to initialize the client with a given configuration.
|
8
8
|
module EppoClient
|
9
|
+
##
|
10
|
+
# Initializes the Eppo client singleton.
|
11
|
+
#
|
12
|
+
# @note The client returned by this method may still be in the process of initializing.
|
13
|
+
# Use the `#wait_for_initialization` method to wait for the client to be ready.
|
14
|
+
#
|
15
|
+
# @param config [EppoClient::Config] The configuration for the client.
|
16
|
+
# @return [EppoClient::Client] The client.
|
9
17
|
def init(config)
|
10
18
|
client = EppoClient::Client.instance
|
11
19
|
client.init(config)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eppo-server-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: aarch64-linux-musl
|
6
6
|
authors:
|
7
7
|
- Eppo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|