Skip to content

Commit 8730e3f

Browse files
committed
Can’t use FileProtectionType on linux
1 parent 2215f92 commit 8730e3f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Source/Shared/Configuration/DiskConfig.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public struct DiskConfig {
1010
public let maxSize: UInt
1111
/// A folder to store the disk cache contents. Defaults to a prefixed directory in Caches if nil
1212
public let directory: URL?
13+
#if os(iOS) || os(tvOS)
1314
/// Data protection is used to store files in an encrypted format on disk and to decrypt them on demand.
1415
/// Support only on iOS and tvOS.
1516
public let protectionType: FileProtectionType?
@@ -23,4 +24,14 @@ public struct DiskConfig {
2324
self.directory = directory
2425
self.protectionType = protectionType
2526
}
27+
#else
28+
public init(name: String, expiry: Expiry = .never,
29+
maxSize: UInt = 0, directory: URL? = nil) {
30+
self.name = name
31+
self.expiry = expiry
32+
self.maxSize = maxSize
33+
self.directory = directory
34+
self.protectionType = protectionType
35+
}
36+
#endif
2637
}

0 commit comments

Comments
 (0)