configure method

void configure({
  1. DVTenantIsolation? isolation,
  2. DVTenantSource? source,
  3. String? headerName,
  4. String? queryParameterName,
  5. Set<String>? ignoredHostLabels,
  6. String? resolver(
    1. Uri uri,
    2. Map<String, String> headers
    )?,
})

Configures resolution. resolver overrides source entirely, for hosts that map tenants some other way (a lookup table, a signed token).

Implementation

void configure({
  DVTenantIsolation? isolation,
  DVTenantSource? source,
  String? headerName,
  String? queryParameterName,
  Set<String>? ignoredHostLabels,
  String? Function(Uri uri, Map<String, String> headers)? resolver,
}) {
  if (isolation != null) _isolation = isolation;
  if (source != null) _source = source;
  if (headerName != null) _headerName = headerName.toLowerCase();
  if (queryParameterName != null) _queryParameterName = queryParameterName;
  if (ignoredHostLabels != null) {
    _ignoredHostLabels = ignoredHostLabels
        .map((String label) => label.toLowerCase())
        .toSet();
  }
  if (resolver != null) _resolver = resolver;
}