This repository has been archived by the owner on Dec 3, 2021. It is now read-only.
/
lesson.proto
106 lines (86 loc) 路 2.24 KB
/
lesson.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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
syntax = "proto3";
package antidote.api.exp;
option go_package = ".;antidote_api_exp";
import "google/api/annotations.proto";
service LessonService {
// Retrieve all Lessons with filter
rpc ListLessons(LessonFilter) returns (Lessons) {
option (google.api.http) = {
get: "/exp/lesson"
};
}
// NOTE that this doesn't just get the prereqs for this lesson, but for all dependent
// lessons as well. So it's not enough to just retrieve from the prereqs field in a given lesson,
// this function will traverse that tree for you and provide a flattened and de-duplicated list.
rpc GetAllLessonPrereqs(LessonSlug) returns (LessonPrereqs) {
option (google.api.http) = {
get: "/exp/lesson/{slug}/prereqs"
};
}
rpc GetLesson(LessonSlug) returns (Lesson) {
option (google.api.http) = {
get: "/exp/lesson/{slug}"
};
}
}
message Lessons {
repeated Lesson lessons = 1;
}
message LessonPrereqs {
repeated string prereqs = 1;
}
message LessonSlug {
string slug = 1;
}
message Lesson {
string Slug = 1;
repeated LessonStage Stages = 2;
string Name = 3;
repeated Endpoint Endpoints = 4;
repeated Connection Connections = 7;
repeated Author Authors = 8;
string Category = 9;
string Diagram = 10;
string Video = 11;
string Tier = 12;
// this field ONLY contains immediately listed prereqs from the lesson meta.
// for a full flattened tree of all prereqs, see GetAllLessonPrereqs
repeated string Prereqs = 13;
repeated string Tags = 14;
string Collection = 15;
string Description = 16;
// This is meant to fill: "How well do you know <ShortDescription>?"
string ShortDescription = 17;
string LessonFile = 18;
string LessonDir = 19;
int32 ReadyDelay = 20;
}
message LessonFilter {
string Category = 2;
}
message LessonStage {
string Description = 1;
string GuideType = 2;
string StageVideo = 3;
}
message Endpoint {
string Name = 1;
string Image = 2;
string ConfigurationType = 3;
repeated int32 AdditionalPorts = 4;
repeated Presentation Presentations = 5;
string Host = 6;
}
message Presentation {
string Name = 1;
int32 Port = 2;
string Type = 3;
}
message Connection {
string A = 1;
string B = 2;
}
message Author {
string Name = 1;
string Link = 2;
}