diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-07 11:40:41 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-07 11:40:41 +0000 |
| commit | 5bd6b9b93cd52da2075bc00a08cf7feca4b85d5c (patch) | |
| tree | bc36818ed88458f33f3f94c33685c9f02c0969f4 /Cargo.toml | |
| parent | 09d9771acaffdc6e798cc32d2a68e6d46a323d3a (diff) | |
Add SyncContext trait and MockSyncContext for purgatory sync
Implement the abstraction layer for purgatory sync operations:
- SyncContext trait: defines interface for repository data fetching,
OID existence checks, git fetch operations, and event processing
- ProcessResult: captures outcomes when releasing events from purgatory
- MockSyncContext: test mock with builder pattern for configuring:
- Clone URLs and which OIDs each URL provides
- Needed OIDs (simulates purgatory state)
- URL failure simulation
- Fetch logging for assertions
The trait uses async_trait for async method support and requires
Send + Sync for use in concurrent sync operations.
This abstraction enables unit testing of sync logic without I/O,
while the real implementation (to be added later) will connect
to actual database, git, and relay systems.
Diffstat (limited to 'Cargo.toml')
| -rw-r--r-- | Cargo.toml | 3 |
1 files changed, 3 insertions, 0 deletions
| @@ -55,6 +55,9 @@ clap = { version = "4.5", features = ["derive", "env"] } | |||
| 55 | anyhow = "1.0" | 55 | anyhow = "1.0" |
| 56 | thiserror = "1.0" | 56 | thiserror = "1.0" |
| 57 | 57 | ||
| 58 | # Async traits | ||
| 59 | async-trait = "0.1" | ||
| 60 | |||
| 58 | # Git (for future use) | 61 | # Git (for future use) |
| 59 | # git-http-backend = "0.3" | 62 | # git-http-backend = "0.3" |
| 60 | 63 | ||