ClusterOptions constructor

ClusterOptions({
  1. String? username,
  2. String? password,
  3. Authenticator? authenticator,
  4. SecurityConfig? security,
  5. TimeoutConfig timeouts = const TimeoutConfig(),
  6. Transcoder transcoder = const DefaultTranscoder(),
  7. DnsConfig? dnsConfig,
  8. String? configProfile,
})

Implementation

ClusterOptions({
  this.username,
  this.password,
  this.authenticator,
  this.security,
  this.timeouts = const TimeoutConfig(),
  this.transcoder = const DefaultTranscoder(),
  this.dnsConfig,
  this.configProfile,
}) {
  if (username != null && password == null) {
    throw ArgumentError.value(
      password,
      'password',
      'must be provided if username is provided',
    );
  }
  if (username == null && password != null) {
    throw ArgumentError.value(
      username,
      'username',
      'must be provided if password is provided',
    );
  }
  if (username != null && authenticator != null) {
    throw ArgumentError.value(
      authenticator,
      'authenticator',
      'cannot be provided if username and password are provided',
    );
  }
}