1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
pub static SUBJECT_STREAM_DOWNLOAD: &str = "gantry.stream.get";
pub static SUBJECT_STREAM_UPLOAD: &str = "gantry.stream.put";
pub static SUBJECT_STREAM_DOWNLOAD_PREFIX: &str = "gantry.stream.download.";
pub static SUBJECT_STREAM_UPLOAD_PREFIX: &str = "gantry.stream.upload.";
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct DownloadRequest {
pub actor: String,
pub revision: u32,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct UploadRequest {
pub actor: String,
pub total_bytes: u64,
pub chunk_size: u64,
pub total_chunks: u64,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct TransferAck {
pub success: bool,
pub actor: String,
pub total_bytes: u64,
pub chunk_size: u64,
pub total_chunks: u64,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct ChunkAck {
pub success: bool,
pub sequence_no: u64,
pub bytes_sent: u64,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct FileChunk {
pub sequence_no: u64,
pub actor: String,
pub total_bytes: u64,
pub chunk_size: u64,
pub total_chunks: u64,
pub chunk_bytes: Vec<u8>,
}