-
Notifications
You must be signed in to change notification settings - Fork 1
/
routes.go
149 lines (142 loc) · 2.26 KB
/
routes.go
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
package main
import (
"net/http"
)
// Route Chemin Web
type Route struct {
Name string
Method string
Pattern string
HandlerFunc http.HandlerFunc
}
// Routes Ensemble de chemins HTTP
type Routes []Route
// A mettre dans un JSON (et charger via Swagger ?)
var routes = Routes{
Route{
"Get Drones Names",
"GET",
"/drones",
GetDronesNames,
},
Route{
"Get Drone Status",
"GET",
"/drone/{name}",
GetDroneStatus,
},
Route{
"Get component integrity",
"GET",
"/health",
GetIntegrity,
},
Route{
"Get Operators",
"GET",
"/operators",
GetOperators,
},
Route{
"Get Boundaries",
"GET",
"/map/boundaries",
GetBoundaries,
},
Route{
"Update the control settings for a drone",
"POST",
"/drone/settings/controls",
UpdateDroneControlSettings,
},
Route{
"Get all drones settings",
"GET",
"/drone/settings/controls",
GetAllDronesSettings,
},
Route{
"Get control settings of one drone",
"GET",
"/drone/{name}/settings/controls",
GetOneDroneSettings,
},
Route{
"Set autopilot target",
"POST",
"/drone/{name}/course/set",
SetCourse,
},
Route{
"Start the maneuvers",
"GET",
"/drone/{name}/autopilot/on",
SetAutopilotOn,
},
Route{
"Stop the maneuvers",
"GET",
"/drone/{name}/autopilot/off",
SetAutopilotOff,
},
Route{
"Get autopilot Status",
"GET",
"/drone/{name}/autopilot",
GetAutopilot,
},
Route{
"Restart video server",
"GET",
"/drone/{name}/video/restart",
RestartVideoServer,
},
Route{
"Restart video stream",
"GET",
"/drone/{name}/stream/restart",
RestartVideoStream,
},
Route{
"Restart Socket Server",
"POST",
"/server/module/restart",
RestartModule,
},
Route{
"Get Drone Health",
"GET",
"/drone/{name}/health",
GetDroneHealth,
},
Route{
"Execute available command",
"POST",
"/command",
ExecuteRemoteCommand,
},
Route{
"Automated Take off of a drone",
"GET",
"/drone/{name}/takeoff",
TakeOffAutomated,
},
Route{
"Automated go home of a drone",
"GET",
"/drone/{name}/home",
GoHomeAutomated,
},
Route{
"Get the flying status of one drone",
"GET",
"/drone/{name}/flying_status",
GetDroneFlyingStatus,
},
Route{
"Get all flying statuses",
"GET",
"/drones/flying_status",
GetDronesFlyingStatus,
},
}