SanitizerCacheManager class abstract

Abstract interface for cache storage implementations.

This interface defines the contract for cache storage in Network Sanitizer. Implement this interface to provide custom cache storage solutions.

The default implementation uses HiveCacheManager which provides cross-platform storage using the Hive database.

Custom Implementation Example

class MyCustomCacheManager implements SanitizerCacheManager {
  @override
  Future<void> setData(String key, Response response) async {
    // Store the response with the given key
  }
  
  @override
  Future<Response?> getData(String key, RequestOptions options) async {
    // Retrieve and return the cached response, or null if not found
    return null;
  }
  
  @override
  Future<void> clearAll() async {
    // Clear all cached data
  }
  
  @override
  Future<void> remove(String key) async {
    // Remove cached data for the specific key
  }
}

Constructors

SanitizerCacheManager()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearAll() Future<void>
Clears all cached data.
getData(String key, RequestOptions options) Future<Response?>
Retrieves a cached response for the given key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String key) Future<void>
Removes a specific cached entry.
setData(String key, Response response) Future<void>
Stores a response in the cache with the given key.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited