spud/daemon/api.go

28 lines
508 B
Go

package daemon
import (
"net/http"
)
func GetApiRoutes() map[string]http.HandlerFunc {
return map[string]http.HandlerFunc{
"/service": ServiceList,
}
}
func ServiceList(w http.ResponseWriter, r *http.Request) {
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)
}