ClusterOptions constructor
ClusterOptions({
- String? username,
- String? password,
- Authenticator? authenticator,
- SecurityConfig? security,
- TimeoutConfig timeouts = const TimeoutConfig(),
- Transcoder transcoder = const DefaultTranscoder(),
- DnsConfig? dnsConfig,
- 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',
);
}
}