-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbase.proto
More file actions
66 lines (54 loc) · 1.7 KB
/
base.proto
File metadata and controls
66 lines (54 loc) · 1.7 KB
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
// Instruction transfer API description
// Used to generate python gRPC classes
syntax = "proto3";
// Important line for Java compatibility
// Will get "Not implemented" without it
package instruction;
// Chunks for big files requests
message Chunk {
bytes buffer = 1;
}
//empty message to be used in rpc
message EmptyRequest {}
// will be used by a Client to request an instruction by its id
message InstructionRequest {
string id = 1;
}
message InstructionMeta {
string id = 1;
string name = 2;
int32 size = 3;
string description = 4;
bytes preview_url = 5;
string modified = 6;
/* more metadata */
}
message InstructionData {
repeated Slide slides = 1; // Instruction - collection of slides
}
message Slide {
message Object {
int32 type = 1; // ==0 => content represents text, ==1-4 => content represents url
string description = 2;
string content = 3; // depends on media_type as described above
string position = 4;
string rotation = 5;
float init_scale = 6;
}
string name = 1;
string description = 2;
string preview_url = 3;
repeated Object objects = 4; // Slide - collection of objects
}
message Status {
int32 status = 1;
}
// please create a name for the service
service DobriyVecher {
// request all the instructions - response with metadata
rpc GetAllInstructions(EmptyRequest) returns (InstructionMeta) {}
// request one instructions - response with downloading all the instruction's data
rpc GetInstruction(InstructionRequest) returns (InstructionData) {}
rpc DownloadMedia(InstructionRequest) returns (stream Chunk) {}
rpc UploadMedia(stream Chunk) returns (Status) {}
}