2024-10-02 02:56:25 +00:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
2024-10-03 03:03:57 +00:00
|
|
|
"context"
|
2024-10-02 02:56:25 +00:00
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2024-10-03 03:03:57 +00:00
|
|
|
func GetApiRoutes() map[string]HandlerFuncWithContext {
|
|
|
|
return map[string]HandlerFuncWithContext{
|
2024-10-02 02:56:25 +00:00
|
|
|
"/service": ServiceList,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-03 03:03:57 +00:00
|
|
|
func ServiceList(w http.ResponseWriter, r *http.Request, c context.Context) {
|
2024-10-02 02:56:25 +00:00
|
|
|
var returnPayload []byte
|
|
|
|
var returnCode int
|
|
|
|
|
|
|
|
switch r.Method {
|
|
|
|
case "POST":
|
|
|
|
returnPayload = []byte("Create service: Not implemented")
|
|
|
|
returnCode = 501
|
|
|
|
default:
|
|
|
|
returnPayload = []byte("Not implemented")
|
|
|
|
returnCode = 501
|
|
|
|
}
|
|
|
|
|
|
|
|
w.WriteHeader(returnCode)
|
|
|
|
w.Write(returnPayload)
|
|
|
|
}
|