Module strategy

Source
Expand description

Traits§

Evaluator
Apply memoised state to a context.

Functions§

_random
constrain
This function is a strategy decorator which compiles to nothing when there are no constraints, or to a constraint evaluating test if there are.
default
https://docs.getunleash.io/user_guide/activation_strategy#standard
flexible_rollout
https://docs.getunleash.io/user_guide/activation_strategy#gradual-rollout stickiness: [default|userId|sessionId|random] groupId: hash key rollout: percentage
group_and_rollout
Get the group and rollout parameters for gradual rollouts.
hostname
https://docs.getunleash.io/user_guide/activation_strategy#hostnames hostNames: names,of,hosts
normalised_hash
Calculates a hash in the standard way expected for Unleash clients. Not required for extension strategies, but reusing this is probably a good idea for consistency across implementations.
normalised_variant_hash
Calculates a hash for variant distribution in the standard way expected for Unleash clients. This differs from the normalised_hash function in that it uses a different seed to ensure a fair distribution.
partial_rollout
Implement partial rollout given a group a variable part and a rollout amount
random
https://docs.getunleash.io/user_guide/activation_strategy#gradualrolloutrandom-deprecated-from-v4---use-gradual-rollout-instead percentage: percentage 0-100
remote_address
https://docs.getunleash.io/user_guide/activation_strategy#ips IPs: 1.2.3.4,AB::CD::::EF,1.2/8
session_id
https://docs.getunleash.io/user_guide/activation_strategy#gradualrolloutsessionid-deprecated-from-v4---use-gradual-rollout-instead percentage: 0-100 groupId: hash key
user_id
https://docs.getunleash.io/user_guide/activation_strategy#gradualrolloutuserid-deprecated-from-v4---use-gradual-rollout-instead percentage: 0-100 groupId: hash key
user_with_id
https://docs.getunleash.io/user_guide/activation_strategy#userids userIds: user,ids,to,match

Type Aliases§

Evaluate
Strategy
Memoise feature state for a strategy.