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 client and store.

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, or null.
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 remotePath of nodeId.
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 remotePath of nodeId. The node clones the repo, so url must 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 mountId after 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 id or throws a DriveException.
resolve(String mountId, {required String strategy, DriveProgress? onProgress}) Future<SyncOutcome>
Resolves a conflict on mountId. strategy is accept-local, accept-origin, or reclone.
sync(String mountId, {SyncDirection? direction, DriveProgress? onProgress}) Future<SyncOutcome>
Synchronizes mountId. With no direction, 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. With syncFirst, runs a final sync; with keepRemote false, 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 mountId and auto-syncs on local changes and on an interval poll. Runs until until completes; 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. home overrides the state directory (tests use an isolated one).