version 1.0.0
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import Foundation
|
||||
|
||||
public protocol KeychainService: Sendable {
|
||||
func save(_ value: String, forKey key: String) async
|
||||
func loadValue(forKey key: String) async -> String?
|
||||
}
|
||||
|
||||
public actor MemoryKeychainService: KeychainService {
|
||||
private var storage: [String: String] = [:]
|
||||
|
||||
public init() {}
|
||||
|
||||
public func save(_ value: String, forKey key: String) async {
|
||||
storage[key] = value
|
||||
}
|
||||
|
||||
public func loadValue(forKey key: String) async -> String? {
|
||||
storage[key]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user