void_core/pipeline/remote/
mod.rs1mod export;
8mod push;
9mod sync;
10
11use std::path::PathBuf;
12use std::sync::Arc;
13use std::time::Duration;
14
15use crate::crypto::RepoSecret;
16use crate::store::RemoteStore;
17use crate::support::events::VoidObserver;
18use crate::support::void_context::VoidContext;
19use crate::transport::ipfs::IpfsBackend;
20
21pub use export::*;
22pub use push::*;
23pub use sync::*;
24
25#[derive(Debug, Clone, Copy, PartialEq, Eq)]
26pub enum CloneMode {
27 Depth1,
28 Full,
29 Lazy,
30 Virtual,
33}
34
35pub struct CloneOptions {
36 pub ctx: VoidContext,
37 pub commit_cid: String,
38 pub backend: IpfsBackend,
39 pub timeout: Duration,
40 pub mode: CloneMode,
41 pub observer: Option<Arc<dyn VoidObserver>>,
43 pub remote: Option<Arc<dyn RemoteStore>>,
45}
46
47#[derive(Debug, Clone)]
48pub struct CloneResult {
49 pub commit_cid: String,
50 pub metadata_cid: String,
51 pub repo_secret: RepoSecret,
52 pub shards_fetched: usize,
53 pub shards_total: usize,
54 pub mode: CloneMode,
55 pub repo_manifest_cid: Option<String>,
57}
58
59pub struct PullOptions {
60 pub ctx: VoidContext,
61 pub commit_cid: String,
62 pub backend: IpfsBackend,
63 pub timeout: Duration,
64 pub mode: CloneMode,
65 pub observer: Option<Arc<dyn VoidObserver>>,
67 pub remote: Option<Arc<dyn RemoteStore>>,
69}
70
71#[derive(Debug, Clone)]
72pub struct PullResult {
73 pub commit_cid: String,
74 pub metadata_cid: String,
75 pub shards_fetched: usize,
76 pub shards_total: usize,
77 pub mode: CloneMode,
78 pub commits_fetched: usize,
79 pub repo_manifest_cid: Option<String>,
81}
82
83pub struct PushOptions {
84 pub ctx: VoidContext,
85 pub commit_cid: Option<String>,
86 pub backend: IpfsBackend,
87 pub timeout: Duration,
88 pub pin: bool,
89 pub backend_name: String,
91 pub full: bool,
93 pub force: bool,
96 pub observer: Option<Arc<dyn VoidObserver>>,
98 pub remote: Option<Arc<dyn RemoteStore>>,
100}
101
102#[derive(Debug, Clone)]
104pub struct SkippedObject {
105 pub cid: String,
107 pub reason: String,
109 pub referenced_by: String,
111}
112
113#[derive(Debug, Clone)]
114pub struct PushResult {
115 pub commit_cid: String,
116 pub objects_pushed: usize,
117 pub pinned: usize,
118 pub commits_pushed: usize,
119 pub skipped_objects: Vec<SkippedObject>,
121}
122
123#[derive(Debug, Clone)]
125pub struct ExportCarOptions {
126 pub ctx: VoidContext,
127 pub commit_cid: Option<String>,
128}
129
130#[derive(Debug, Clone)]
132pub struct ExportCarResult {
133 pub commit_cid: String,
134 pub car_path: PathBuf,
135 pub blocks_exported: usize,
136 pub car_size: u64,
137}