EasyLanisClient.inMemory constructor

EasyLanisClient.inMemory({
  1. String? documentCacheDirectory,
  2. HttpClientAdapter? httpAdapter,
  3. String userAgent = 'liblanis/0.1.0',
  4. bool storageEnabled = true,
  5. Duration? storageMaxAge,
  6. int? storageMaxBytes,
  7. UnexpectedErrorHandler? onUnexpectedError,
})

In-memory database (CI unit tests, quick scripts).

Implementation

factory EasyLanisClient.inMemory({
  String? documentCacheDirectory,
  HttpClientAdapter? httpAdapter,
  String userAgent = 'liblanis/0.1.0',
  bool storageEnabled = true,
  Duration? storageMaxAge,
  int? storageMaxBytes,
  UnexpectedErrorHandler? onUnexpectedError,
}) {
  LanisClient.configure(
    documentCacheDirectory: documentCacheDirectory,
    httpAdapter: httpAdapter,
    userAgent: userAgent,
    storageEnabled: storageEnabled,
    storageMaxAge: storageMaxAge,
    storageMaxBytes: storageMaxBytes,
    onUnexpectedError: onUnexpectedError,
  );
  final config = LanisClient.config!;
  final db = LanisDatabase.open(
    path: config.databasePath,
    secretStore: config.secretStore,
  );
  return EasyLanisClient._(
    config: config,
    db: db,
    ephemeral: false,
  );
}