feat: Adds vault client
This commit is contained in:
@@ -59,6 +59,16 @@ extension ConfigurationClient: DependencyKey {
|
||||
public static var liveValue: Self {
|
||||
.live(environment: ProcessInfo.processInfo.environment)
|
||||
}
|
||||
|
||||
@_spi(Internal)
|
||||
public static func mock(_ configuration: Configuration = .mock) -> Self {
|
||||
.init(
|
||||
find: { throw MockFindError() },
|
||||
generate: Self().generate,
|
||||
load: { _ in configuration },
|
||||
write: Self().write
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
struct LiveConfigurationClient {
|
||||
@@ -229,3 +239,5 @@ enum ConfigurationError: Error {
|
||||
case decodingError
|
||||
case fileExists(path: String)
|
||||
}
|
||||
|
||||
struct MockFindError: Error {}
|
||||
|
||||
Reference in New Issue
Block a user