LocalStoreFactory
public class LocalStoreFactory : CoreDataControllerFactory
Factory for all public eRpLocalStorage
instances.
Guarantees to always return the same instance of CoreDataController
during it’s lifetime
-
Declaration
Swift
public let databaseUrl: URL
-
Initialize a CoreDataControllerFactory
Declaration
Swift
public init( url databaseUrl: URL = defaultDatabaseUrl, fileProtection: FileProtectionType = .completeUnlessOpen )
Parameters
databaseUrl
The database location on device
fileProtection
The file protection level
-
Lazy initializer for the CoreDataController
Throws
When store can not be initializedDeclaration
Swift
public func loadCoreDataController() throws -> CoreDataController
Return Value
The same instance of
CoreDataController
during the lifetime ofCoreDataControllerFactory
-
Default Local FHIR data store url
Declaration
Swift
public static var defaultDatabaseUrl: URL
-
Declaration
Swift
public struct Failing : CoreDataControllerFactory
-
Returns a factory which fails returning a CoreDataController
Declaration
Swift
public static let failing: LocalStoreFactory.Failing