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::support::events::VoidObserver;
17use crate::support::void_context::VoidContext;
18use crate::transport::ipfs::IpfsBackend;
19
20pub use export::*;
21pub use push::*;
22pub use sync::*;
23
24#[derive(Debug, Clone, Copy, PartialEq, Eq)]
25pub enum CloneMode {
26 Depth1,
27 Full,
28 Lazy,
29}
30
31pub struct CloneOptions {
32 pub ctx: VoidContext,
33 pub commit_cid: String,
34 pub backend: IpfsBackend,
35 pub timeout: Duration,
36 pub mode: CloneMode,
37 pub observer: Option<Arc<dyn VoidObserver>>,
39}
40
41#[derive(Debug, Clone)]
42pub struct CloneResult {
43 pub commit_cid: String,
44 pub metadata_cid: String,
45 pub repo_secret: RepoSecret,
46 pub shards_fetched: usize,
47 pub shards_total: usize,
48 pub mode: CloneMode,
49 pub repo_manifest_cid: Option<String>,
51}
52
53pub struct PullOptions {
54 pub ctx: VoidContext,
55 pub commit_cid: String,
56 pub backend: IpfsBackend,
57 pub timeout: Duration,
58 pub mode: CloneMode,
59 pub observer: Option<Arc<dyn VoidObserver>>,
61}
62
63#[derive(Debug, Clone)]
64pub struct PullResult {
65 pub commit_cid: String,
66 pub metadata_cid: String,
67 pub shards_fetched: usize,
68 pub shards_total: usize,
69 pub mode: CloneMode,
70 pub commits_fetched: usize,
71 pub repo_manifest_cid: Option<String>,
73}
74
75pub struct PushOptions {
76 pub ctx: VoidContext,
77 pub commit_cid: Option<String>,
78 pub backend: IpfsBackend,
79 pub timeout: Duration,
80 pub pin: bool,
81 pub backend_name: String,
83 pub full: bool,
85 pub force: bool,
88 pub observer: Option<Arc<dyn VoidObserver>>,
90}
91
92#[derive(Debug, Clone)]
94pub struct SkippedObject {
95 pub cid: String,
97 pub reason: String,
99 pub referenced_by: String,
101}
102
103#[derive(Debug, Clone)]
104pub struct PushResult {
105 pub commit_cid: String,
106 pub objects_pushed: usize,
107 pub pinned: usize,
108 pub commits_pushed: usize,
109 pub skipped_objects: Vec<SkippedObject>,
111}
112
113#[derive(Debug, Clone)]
115pub struct ExportCarOptions {
116 pub ctx: VoidContext,
117 pub commit_cid: Option<String>,
118}
119
120#[derive(Debug, Clone)]
122pub struct ExportCarResult {
123 pub commit_cid: String,
124 pub car_path: PathBuf,
125 pub blocks_exported: usize,
126 pub car_size: u64,
127}