KeyscopeConnectionSettings class
Configuration for a Valkey connection. Holds all configuration options for creating a new connection.
Used by KeyscopePool to create new client instances.
Constructors
-
KeyscopeConnectionSettings({String host = '127.0.0.1', int port = 6379, String? username, String? password, Duration commandTimeout = const Duration(seconds: 10), Duration connectTimeout = const Duration(seconds: 10), bool useSsl = false, SecurityContext? sslContext, bool onBadCertificate(X509Certificate)?, int database = 0, ReadPreference readPreference = ReadPreference.master, LoadBalancingStrategy loadBalancingStrategy = LoadBalancingStrategy.roundRobin, List<
KeyscopeConnectionSettings> ? explicitReplicas, AddressMapper? addressMapper})
Properties
- addressMapper → AddressMapper?
-
final
- commandTimeout → Duration
-
The timeout for database commands.
The maximum duration to wait for a response to any command.
Defaults to 10 seconds.
final
- connectTimeout → Duration
-
The timeout for establishing a socket connection.
final
- database → int
-
The database index to select after connection. Default is 0.
final
-
explicitReplicas
→ List<
KeyscopeConnectionSettings> ? -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
The host of the Valkey server.
final
- loadBalancingStrategy → LoadBalancingStrategy
-
final
- onBadCertificate → bool Function(X509Certificate)?
-
Callback to handle bad certificates (e.g., self-signed certificates in
dev).
Returns
trueto allow the connection,falseto abort.final - password → String?
-
The password for authentication.
final
- port → int
-
The port of the Valkey server.
final
- readPreference → ReadPreference
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sslContext → SecurityContext?
-
Custom SecurityContext for advanced SSL configurations
(e.g., providing a client certificate or a custom CA).
final
- username → String?
-
The username for ACL authentication (Valkey 6.0+).
final
- useSsl → bool
-
Whether to use an encrypted SSL/TLS connection.
Default is
false.final
Methods
-
copyWith(
{String? host, int? port, String? username, String? password, Duration? commandTimeout, Duration? connectTimeout, bool? useSsl, SecurityContext? sslContext, bool onBadCertificate(X509Certificate)?, int? database, ReadPreference? readPreference, LoadBalancingStrategy? loadBalancingStrategy, List< KeyscopeConnectionSettings> ? explicitReplicas, AddressMapper? addressMapper}) → KeyscopeConnectionSettings - Creates a copy of this settings object with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited