1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-14 10:17:26 +08:00
docker-labs/handlers/delete_instance.go
Jonathan Leibiusky (@xetorthio) dde49d8700 Initial commit
2016-10-08 03:12:48 +02:00

22 lines
476 B
Go

package handlers
import (
"net/http"
"github.com/go-zoo/bone"
"github.com/xetorthio/play-with-docker/services"
)
func DeleteInstance(rw http.ResponseWriter, req *http.Request) {
sessionId := bone.GetValue(req, "sessionId")
instanceId := bone.GetValue(req, "instanceId")
s := services.GetSession(sessionId)
i := services.GetInstance(s, instanceId)
err := services.DeleteInstance(s, i)
if err != nil {
rw.WriteHeader(http.StatusInternalServerError)
return
}
}