-
-
Notifications
You must be signed in to change notification settings - Fork 111
/
api.go
28 lines (25 loc) · 741 Bytes
/
api.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
package docker
import (
"net/http"
"github.com/azukaar/cosmos-server/src/utils"
)
func ContainersIdRoute(w http.ResponseWriter, req *http.Request) {
if (req.Method == "GET") {
// ContainerGet(w, req)
} else {
utils.Error("UserRoute: Method not allowed" + req.Method, nil)
utils.HTTPError(w, "Method not allowed", http.StatusMethodNotAllowed, "HTTP001")
return
}
}
func ContainersRoute(w http.ResponseWriter, req *http.Request) {
if (req.Method == "POST") {
// CreateContainer(w, req)
} else if (req.Method == "GET") {
ListContainersRoute(w, req)
} else {
utils.Error("UserRoute: Method not allowed" + req.Method, nil)
utils.HTTPError(w, "Method not allowed", http.StatusMethodNotAllowed, "HTTP001")
return
}
}