Unleash v1.7.0 Unleash.Strategies behaviour View Source

Used to get all available strategies in the client. You can add your strategies to the client by extending this module:

defmodule MyApp.Strategies do
  @behaviour Unleash.Strategies

  def strategies, do: Unleash.Strategies.strategies() ++ []
end

and then setting it in your configuration:

config :unleash, Unleash, strategies: MyApp.Strategies

Link to this section Summary

Functions

Returns all the strategies that are supported by this client. They can be viewed under Strategy.

Callbacks

Should return a list of all the avilable strategies in the format {"name", Module}. The name must match the name of the strategy in the Unleash server, and the module must implement the Unleash.Strategy behaviour.

Link to this section Functions

Returns all the strategies that are supported by this client. They can be viewed under Strategy.

For completeness, the list is:

Link to this section Callbacks

Link to this callback

strategies()

View Source
strategies() :: [{String.t(), module()}]

Should return a list of all the avilable strategies in the format {"name", Module}. The name must match the name of the strategy in the Unleash server, and the module must implement the Unleash.Strategy behaviour.