-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpractice.proto
36 lines (26 loc) · 892 Bytes
/
practice.proto
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
syntax = "proto3";
message Course {
string name = 1; //name of the course
repeated string authors =2; //authors of the course
map<string, Lecture> lectures = 3; //lecture name is linked to a lecture platform
}
message Lecture {
oneof content { //oneof is used here because the content of the lecture can either be an article or a video (meaning they are mutually exclusive)
Video video = 1;
Article article = 2;
}
}
enum VideoType { //enum is used because these are the possible state of files acceptable for the Video section
UNSPECIFIED = 0; //a default type, it flags any other format that is not stated here as unsupported
MP4 = 1;
MOV = 2;
}
message Video {
VideoType type = 1;
string url = 2;
}
message Article {
string text = 1;
}
//the minimum tag for a message is 1
//enumeration is used when you have an exhaustive list of state