mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 10:17:26 +08:00
It fixes lots of bugs, can fallback to long polling, resize viewport of terminals and share clients state of the session, so they all see the same thing.
23 lines
475 B
Go
23 lines
475 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/franela/play-with-docker/services"
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func DeleteInstance(rw http.ResponseWriter, req *http.Request) {
|
|
vars := mux.Vars(req)
|
|
sessionId := vars["sessionId"]
|
|
instanceName := vars["instanceName"]
|
|
|
|
s := services.GetSession(sessionId)
|
|
i := services.GetInstance(s, instanceName)
|
|
err := services.DeleteInstance(s, i)
|
|
if err != nil {
|
|
rw.WriteHeader(http.StatusInternalServerError)
|
|
return
|
|
}
|
|
}
|