BalancingRule.fromJson constructor

BalancingRule.fromJson(
  1. Object? json
)

Implementation

factory BalancingRule.fromJson(Object? json) {
  final map = asJsonMap(json, 'balancing rule');
  return BalancingRule(
    tag: map['tag'] as String,
    selectors: XrayStringList.fromJson(map['selector']),
    strategy: map['strategy'] == null
        ? null
        : StrategyConfig.fromJson(map['strategy']),
    fallbackTag: map['fallbackTag'] as String?,
  );
}