DriveManager class
Orchestrates OmnyDrive mounts over OmnyShell drive sessions.
The client is the active side of a mount: it runs OmnyDrive's directory
synchronizer (for dir mounts) against a ChannelContentSource that reaches
the node, or issues git RPCs the node executes (for git mounts). Mount
state is persisted in a MountStore; the Hub and Node need no mount registry.
Constructors
- DriveManager(ClientRuntime client, MountStore store)
-
Creates a manager over
clientandstore.
Properties
- client → ClientRuntime
-
The connected, authenticated client.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- store → MountStore
-
The persisted mount registry.
final
Methods
-
get(
String id) → MountRecord? -
The mount with
id, ornull. -
list(
) → List< MountRecord> - All known mounts, ordered by id.
-
mountDirectory(
{required String localDir, required String nodeId, required String remotePath, String? name, bool readWrite = false, bool initialSync = true, DriveProgress? onProgress}) → Future< MountRecord> -
Mounts a local directory onto
remotePathofnodeId. -
mountGit(
{required String url, required String nodeId, required String remotePath, String? name, String? branch, int? depth, bool readWrite = false, DriveProgress? onProgress}) → Future< MountRecord> -
Mounts a git repository onto
remotePathofnodeId. The node clones the repo, sourlmust be reachable from the node. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remount(
String mountId, {DriveProgress? onProgress}) → Future< MountRecord> -
Re-establishes
mountIdafter a node restart or fresh CLI run: git mounts re-clone (the node reuses an existing checkout), directory mounts re-anchor on the node and push the local copy back up. -
require(
String id) → MountRecord -
Looks up
idor throws a DriveException. -
resolve(
String mountId, {required String strategy, DriveProgress? onProgress}) → Future< SyncOutcome> -
Resolves a conflict on
mountId.strategyisaccept-local,accept-origin, orreclone. -
sync(
String mountId, {SyncDirection? direction, DriveProgress? onProgress}) → Future< SyncOutcome> -
Synchronizes
mountId. With nodirection, picks one automatically: read-only mounts always push; read-write mounts push, pull or no-op based on which side changed (a two-sided change surfaces a conflict). -
toString(
) → String -
A string representation of this object.
inherited
-
unmount(
String mountId, {bool syncFirst = false, bool keepRemote = true}) → Future< void> -
Unmounts
mountId. WithsyncFirst, runs a final sync; withkeepRemotefalse, deletes the mount's files on the node (dir mounts only). -
watch(
String mountId, {Duration interval = const Duration(seconds: 15), Duration debounce = const Duration(milliseconds: 500), void log(String message)?, DriveProgress? onProgress, Future< void> ? until}) → Future<void> -
Watches
mountIdand auto-syncs on local changes and on anintervalpoll. Runs untiluntilcompletes; when omitted it runs until the returned future is never completed (the caller cancels via process signal). Directory mounts also react to filesystem events.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
open(
ClientRuntime client, {String? home}) → Future< DriveManager> -
Loads the mount store and returns a manager bound to
client.homeoverrides the state directory (tests use an isolated one).