View Source SplitClient (SplitClient v0.3.0)
A Split.io client for Elixir.
See Glossary for explanations about function arguments and return values
Link to this section Summary
Functions
Get all the treatments for one or more traffic types.
Get the treatment for a specific split.
Get the treatments for multiple splits.
Determine if a particular split is turned off. This is syntax sugar around the
get_treatment/3
function. If your treatment has a meaningful config that
could be returned then use get_treatment/3
instead
Determine if a particular split is turned on. This is syntax sugar around the
get_treatment/3
function. If your treatment has a meaningful config that
could be returned then use get_treatment/3
instead
Link to this section Functions
Get all the treatments for one or more traffic types.
args
Args
keys
- A list of maps containing the following::matching_key
:traffic_type
:bucketing_key
- Optional
options
Options
:attributes
examples
Examples
iex> SplitClient.get_all_treatments(%{matching_key: "unique-customer-id", target_type: "customer"}, %{matching_key: "unique-user-id", target_type: "user"})
%{"customer" => %{"shiny-feature" => %Treatment{treatment: "on"}}, "user" => %{"my-experiment" => %Treatment{treatment: "off"}}}
@spec get_treatment(key :: String.t(), split_name :: String.t(), options :: keyword()) :: Treatment.t()
Get the treatment for a specific split.
args
Args
key
split_name
options
Options
:attributes
:bucketing_key
examples
Examples
iex> SplitClient.get_treatment("unique-customer-id", "shiny-feature")
%Treatment{split_name: "shiny-feature", treatment: "on"}
@spec get_treatments( key :: String.t(), split_names :: [String.t()], options :: keyword() ) :: map()
Get the treatments for multiple splits.
args
Args
key
split_name
options
Options
:attributes
:bucketing_key
examples
Examples
iex> SplitClient.get_treatments("unique-customer-id", ["shiny-feature", "my-experiment"])
%{"shiny-feature" => %Treatment{treatment: "on"}, "my-experiment" => %Treatment{split_name: "my-experiment", treatment: "off"}}
Determine if a particular split is turned off. This is syntax sugar around the
get_treatment/3
function. If your treatment has a meaningful config that
could be returned then use get_treatment/3
instead
args
Args
key
split_name
options
Options
:attributes
:bucketing_key
examples
Examples
iex> SplitClient.off?("unique-customer-id", "shiny-feature")
true
Determine if a particular split is turned on. This is syntax sugar around the
get_treatment/3
function. If your treatment has a meaningful config that
could be returned then use get_treatment/3
instead
args
Args
key
split_name
options
Options
:attributes
:bucketing_key
examples
Examples
iex> SplitClient.on?("unique-customer-id", "shiny-feature")
true