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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
pub const OP_CREATE_CONTAINER: &str = "CreateContainer";
pub const OP_REMOVE_CONTAINER: &str = "RemoveContainer";
pub const OP_REMOVE_OBJECT: &str = "RemoveObject";
pub const OP_LIST_OBJECTS: &str = "ListObjects";
pub const OP_UPLOAD_CHUNK: &str = "UploadChunk";
pub const OP_START_DOWNLOAD: &str = "StartDownload";
pub const OP_START_UPLOAD: &str = "StartUpload";
pub const OP_RECEIVE_CHUNK: &str = "ReceiveChunk";
pub const OP_GET_OBJECT_INFO: &str = "GetObjectInfo";
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct FileChunk {
pub sequence_no: u64,
pub container: String,
pub id: String,
pub total_bytes: u64,
pub chunk_size: u64,
pub chunk_bytes: Vec<u8>,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct Container {
pub id: String,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct ContainerList {
pub containers: Vec<Container>,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct Blob {
pub id: String,
pub container: String,
pub byte_size: u64,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct BlobList {
pub blobs: Vec<Blob>,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct StreamRequest {
pub id: String,
pub container: String,
pub chunk_size: u64,
}
#[derive(Debug, PartialEq, Deserialize, Serialize)]
pub struct Transfer {
pub blob_id: String,
pub container: String,
pub chunk_size: u64,
pub total_size: u64,
pub total_chunks: u64,
}