EasyLanisClient.open constructor

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

Persistent file database (CLI tools, other apps).

Implementation

factory EasyLanisClient.open({
  required String databasePath,
  required SecretStore secretStore,
  String? documentCacheDirectory,
  HttpClientAdapter? httpAdapter,
  String userAgent = 'liblanis/0.1.0',
  bool storageEnabled = true,
  Duration? storageMaxAge,
  int? storageMaxBytes,
  UnexpectedErrorHandler? onUnexpectedError,
}) {
  LanisClient.configure(
    databasePath: databasePath,
    secretStore: secretStore,
    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,
  );
}