A protocol for a cache storage.
public protocol CacheProtocol
The purpose of a cache storage is to persistently store string keys and values. The cache is used for storing things like device identifiers, authentication tokens and such.
Adds a value with a specified key to the cache.
func setValue(_ value: String, forKey: String)
- value: The value to store in the cache.
- forKey: The key to use for addressing the value.
Retrieves the value from the cache using the provided key.
func getValue(forKey: String) -> String?
- forKey: The key to use for addressing the value.
The value stored in the cache or nil
if no value could be found for the key provided.