Skip to content

Commit

Permalink
Add filePath to Entry
Browse files Browse the repository at this point in the history
  • Loading branch information
vadymmarkov committed Aug 13, 2018
1 parent 35d8eea commit c6c7f7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Source/Shared/Library/Entry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ public struct Entry<T> {
public let object: T
/// Expiry date
public let expiry: Expiry
/// Associated meta data, if any
public let meta: [String: Any]
/// File path to the cached object
public let filePath: String?

init(object: T, expiry: Expiry, meta: [String: Any] = [:]) {
init(object: T, expiry: Expiry, filePath: String? = nil) {
self.object = object
self.expiry = expiry
self.meta = meta
self.filePath = filePath
}
}
6 changes: 1 addition & 5 deletions Source/Shared/Storage/DiskStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,10 @@ extension DiskStorage: StorageAware {
throw StorageError.malformedFileAttributes
}

let meta: [String: Any] = [
"filePath": filePath
]

return Entry(
object: object,
expiry: Expiry.date(date),
meta: meta
filePath: filePath
)
}

Expand Down

0 comments on commit c6c7f7b

Please sign in to comment.