package handlers import ( "encoding/json" "net/http" "github.com/gorilla/mux" "github.com/play-with-docker/play-with-docker/services" ) func GetSession(rw http.ResponseWriter, req *http.Request) { vars := mux.Vars(req) sessionId := vars["sessionId"] session := services.GetSession(sessionId) if session == nil { rw.WriteHeader(http.StatusNotFound) return } json.NewEncoder(rw).Encode(session) }