JsonCacheEngine class
The JSON engine is a provided cache engine to be used as is in your project. It will use regular .json files to store and load response from a directus instance
on set : The engine will automatically create new json file for each specific entry. The name for the file will match the entry key. The content will be encoded as json within the file on read : The engine will try to find a file for the provided key if found: it will load the content of the file and parse the json to return a CacheEntry object if not found : it will return null
- Implemented types
Constructors
- JsonCacheEngine({required String cachefolderPath})
Properties
- cachefolderPath → String
-
The base folder path for all json cache files to be stored and loaded
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearCache(
) → Future< void> -
override
-
getCacheEntry(
{required String key}) → Future< CacheEntry?> -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeCacheEntriesWithTag(
{required String tag}) → Future< void> -
override
-
removeCacheEntry(
{required String key}) → Future< void> -
override
-
setCacheEntry(
{required CacheEntry cacheEntry, required List< String> tags}) → Future<void> -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited