enum FlagBy
How a Flag splits traffic (§14.2): by user, by node or by tenant.
Example:
dynamic Features {
beta: Flag = Flag.percent(50, by: .Tenant)
}
fn main() io {
let f = Features.get()
let a = Principal.User("u1", [], Map.new(), false, "acme")
let b = Principal.User("u2", [], Map.new(), false, "acme")
print("{f.beta.on(r#for: a) == f.beta.on(r#for: b)}")
}Вывод
true
pub(api) enum FlagByС версии. 1.0.0-beta
Варианты
User | Split by the id of the user. |
Node | Split by the id of the node. |
Tenant | Split by the tenant of the caller. |
Определено в: std/core/dynconf.oxl:134