43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func (rest *REST) entities(w http.ResponseWriter, r *http.Request) {
|
|
switch r.Method {
|
|
case http.MethodPut:
|
|
rest.entitiesReplace(w, r)
|
|
case http.MethodPatch:
|
|
rest.entitiesUpdate(w, r)
|
|
case http.MethodPost:
|
|
rest.entitiesCreate(w, r)
|
|
case http.MethodGet:
|
|
rest.entitiesGet(w, r)
|
|
case http.MethodDelete:
|
|
rest.entitiesDelete(w, r)
|
|
default:
|
|
http.NotFound(w, r)
|
|
}
|
|
}
|
|
|
|
func (rest *REST) entitiesCreate(w http.ResponseWriter, r *http.Request) {
|
|
http.Error(w, "not impl", http.StatusNotImplemented)
|
|
}
|
|
|
|
func (rest *REST) entitiesDelete(w http.ResponseWriter, r *http.Request) {
|
|
http.Error(w, "not impl", http.StatusNotImplemented)
|
|
}
|
|
|
|
func (rest *REST) entitiesGet(w http.ResponseWriter, r *http.Request) {
|
|
http.Error(w, "not impl", http.StatusNotImplemented)
|
|
}
|
|
|
|
func (rest *REST) entitiesReplace(w http.ResponseWriter, r *http.Request) {
|
|
http.Error(w, "not impl", http.StatusNotImplemented)
|
|
}
|
|
|
|
func (rest *REST) entitiesUpdate(w http.ResponseWriter, r *http.Request) {
|
|
http.Error(w, "not impl", http.StatusNotImplemented)
|
|
}
|