wcpan.drive.core¶
- wcpan.drive.core.create_drive(*, file, snapshot)¶
Create a configured Drive instance for single-source usage.
- Parameters:
file (CreateFileService) – Factory function returning a FileService context manager. Also accepts the output of compose_service().
snapshot (CreateSnapshotService) – Factory function returning a SnapshotService context manager. Also accepts the output of compose_service().
- Yields:
A fully configured Drive instance ready for operations.
- Raises:
InvalidServiceError – If the service reports an incompatible API version.
- Return type:
- wcpan.drive.core.create_multi_drive(sources)¶
Create a configured Drive instance for cloud storage operations.
Accepts a sequence of SourceConfig objects. With a single source, yields a single-mode Drive (paths unchanged). With multiple sources, yields a multi-mode Drive where each source’s paths are prefixed with its name (e.g., /google/docs/file.txt).
- Parameters:
sources (Sequence[SourceConfig]) – One or more SourceConfig objects describing storage backends.
- Yields:
A fully configured Drive instance ready for operations.
- Raises:
InvalidServiceError – If any service reports an incompatible API version.
ValueError – If sources is empty.
- Return type:
- wcpan.drive.core.compose_service(base, *middleware)¶
- Parameters:
base (CreateService)
middleware (CreateServiceMiddleware)
- Return type:
CreateService