resource_storage library

Base classes to implement resource storage for cached_resource package.

Classes

CacheEntry<V>
Base cache entry
JsonStorageAdapter<V>
Helper class for toJson/fromJson conversion using provided executor and decode.
Logger
Base interface of Logger with default implementation
ResourceStorage<K, V>
Base interface for resource cache storage
ResourceStorageProvider
Interface for resource storage factory
TimestampProvider
Helper class to provide timestamp in milliseconds from the Unix epoch Can be used to define custom timestamp logic in tests

Enums

LoggerLevel
The severity level for log entry

Functions

syncStorageExecutor<T>(FutureOr<T> task()) FutureOr<T>
Synchronous task executor that just calls a task

Typedefs

StorageDecoder<V> = FutureOr<V> Function(dynamic storedValue)
Base interface for persistent storage decoding.
StorageExecutor = FutureOr<T> Function<T>(FutureOr<T> task())
Interface for task executor that can be provided externally