Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis configuration provider #215

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
R marked factory private
F added factory as additional optional parameter with default fallback on internal standard RedisProvider
apemaia99 committed May 12, 2024

Unverified

This user has not yet uploaded their public signing key.
commit 0dcb230634aa1a6c7458aabcadedca9d8b44c04b
7 changes: 4 additions & 3 deletions Sources/Redis/Configuration/RedisConfiguration.swift
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ public struct RedisConfiguration {
public let tlsConfiguration: TLSConfiguration?
public let tlsHostname: String?

let factory: RedisFactory.Type
private let factory: RedisFactory.Type
var provider: RedisFactory {
factory.init(configuration: self)
}
@@ -80,14 +80,15 @@ public struct RedisConfiguration {
tlsConfiguration: TLSConfiguration? = nil,
tlsHostname: String? = nil,
database: Int? = nil,
pool: PoolOptions = .init()
pool: PoolOptions = .init(),
factory: RedisFactory.Type? = nil
) throws {
self.serverAddresses = serverAddresses
self.password = password
self.tlsConfiguration = tlsConfiguration
self.tlsHostname = tlsHostname
self.database = database
self.pool = pool
factory = RedisProvider.self
self.factory = factory ?? RedisProvider.self
}
}