forked from snickers/snickers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.go
34 lines (29 loc) · 1.07 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
package server
import "net/http"
type Route int
const (
CreateJob Route = iota
DeleteJob
ListJobs
GetJobDetails
StartJob
CreatePreset
UpdatePreset
ListPresets
GetPresetDetails
DeletePreset
)
var Routes = map[Route]RouterArguments{
//Job routes
CreateJob: RouterArguments{Path: "/jobs", Method: http.MethodPost},
ListJobs: RouterArguments{Path: "/jobs", Method: http.MethodGet},
GetJobDetails: RouterArguments{Path: "/jobs/{jobID}", Method: http.MethodGet},
DeleteJob: RouterArguments{Path: "/jobs/{jobID}", Method: http.MethodDelete},
StartJob: RouterArguments{Path: "/jobs/{jobID}/start", Method: http.MethodPost},
//Preset routes
CreatePreset: RouterArguments{Path: "/presets", Method: http.MethodPost},
UpdatePreset: RouterArguments{Path: "/presets", Method: http.MethodPut},
ListPresets: RouterArguments{Path: "/presets", Method: http.MethodGet},
GetPresetDetails: RouterArguments{Path: "/presets/{presetName}", Method: http.MethodGet},
DeletePreset: RouterArguments{Path: "/presets/{presetName}", Method: http.MethodDelete},
}