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}
31
32pub struct CloneOptions {
33 pub ctx: VoidContext,
34 pub commit_cid: String,
35 pub backend: IpfsBackend,
36 pub timeout: Duration,
37 pub mode: CloneMode,
38 pub observer: Option<Arc<dyn VoidObserver>>,
40 pub remote: Option<Arc<dyn RemoteStore>>,
42}
43
44#[derive(Debug, Clone)]
45pub struct CloneResult {
46 pub commit_cid: String,
47 pub metadata_cid: String,
48 pub repo_secret: RepoSecret,
49 pub shards_fetched: usize,
50 pub shards_total: usize,
51 pub mode: CloneMode,
52 pub repo_manifest_cid: Option<String>,
54}
55
56pub struct PullOptions {
57 pub ctx: VoidContext,
58 pub commit_cid: String,
59 pub backend: IpfsBackend,
60 pub timeout: Duration,
61 pub mode: CloneMode,
62 pub observer: Option<Arc<dyn VoidObserver>>,
64 pub remote: Option<Arc<dyn RemoteStore>>,
66}
67
68#[derive(Debug, Clone)]
69pub struct PullResult {
70 pub commit_cid: String,
71 pub metadata_cid: String,
72 pub shards_fetched: usize,
73 pub shards_total: usize,
74 pub mode: CloneMode,
75 pub commits_fetched: usize,
76 pub repo_manifest_cid: Option<String>,
78}
79
80pub struct PushOptions {
81 pub ctx: VoidContext,
82 pub commit_cid: Option<String>,
83 pub backend: IpfsBackend,
84 pub timeout: Duration,
85 pub pin: bool,
86 pub backend_name: String,
88 pub full: bool,
90 pub force: bool,
93 pub observer: Option<Arc<dyn VoidObserver>>,
95 pub remote: Option<Arc<dyn RemoteStore>>,
97}
98
99#[derive(Debug, Clone)]
101pub struct SkippedObject {
102 pub cid: String,
104 pub reason: String,
106 pub referenced_by: String,
108}
109
110#[derive(Debug, Clone)]
111pub struct PushResult {
112 pub commit_cid: String,
113 pub objects_pushed: usize,
114 pub pinned: usize,
115 pub commits_pushed: usize,
116 pub skipped_objects: Vec<SkippedObject>,
118}
119
120#[derive(Debug, Clone)]
122pub struct ExportCarOptions {
123 pub ctx: VoidContext,
124 pub commit_cid: Option<String>,
125}
126
127#[derive(Debug, Clone)]
129pub struct ExportCarResult {
130 pub commit_cid: String,
131 pub car_path: PathBuf,
132 pub blocks_exported: usize,
133 pub car_size: u64,
134}