openRepository method
- required String path,
- LocalSecret? localSecret,
inherited
Opens an existing repository.
path
: path to the local file the repo is stored in.local_secret
: a local secret. See theread_secret
andwrite_secret
params inSelf::session_create_repository
for more details. If this repo uses local secret (s), this determines the access mode the repo is opened in:read_secret
opens it in read mode,write_secret
opens it in write mode and no secret or wrong secret opens it in blind mode. If this repo doesn't use local secret(s), the repo is opened in the maximal mode specified when the repo was created.
Implementation
Future<Repository> openRepository({
required String path,
LocalSecret? localSecret,
}) async {
final request = RequestSessionOpenRepository(
path: path,
localSecret: localSecret,
);
final response = await client.invoke(request);
switch (response) {
case ResponseRepository(value: final value): return Repository(client, value);
default: throw UnexpectedResponse();
}
}