Created
June 15, 2018 08:33
-
-
Save onmyway133/1f3501d6b5217c47604bdcce09918f16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// A protocol used for saving and loading from storage | |
public protocol StorageAware { | |
func object<T: Codable>(ofType type: T.Type, forKey key: String) throws -> T | |
func entry<T: Codable>(ofType type: T.Type, forKey key: String) throws -> Entry<T> | |
func removeObject(forKey key: String) throws | |
func setObject<T: Codable>(_ object: T, forKey key: String, expiry: Expiry?) throws | |
func existsObject<T: Codable>(ofType type: T.Type, forKey key: String) throws -> Bool | |
func removeAll() throws | |
func removeExpiredObjects() throws | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment