OxL Справочник OxL
РусскийEnglish

enum DynScope

Where an override applies (§14.2): everywhere, or to one role / zone / node / tenant. The most specific layer wins.

Example:

oxl✓ проверяется в CI
dynamic Limits {
  rps: u32 = 100
  title: str = "shop"
}

fn main() io {
  let l = Limits.get()
  l.rps.set(200)!
  l.rps.set(300, .Role("api"))!
  print("{l.rps.get()}")
  l.rps.unset(.Role("api"))!
  print("{l.rps.get()}")
}
Вывод
200
200
pub(api) enum DynScope

С версии. 1.0.0-beta

Варианты

Global

Applies to every node.

Role(name: str)

Applies to the nodes that have the role name.

Zone(name: str)

Applies to the nodes of the zone name.

Node(name: str)

Applies to the node name.

Tenant(name: str)

Applies to the calls of the tenant name.

Определено в: std/core/dynconf.oxl:103

См. также