func KillContainer(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) hostname := vars["hostname"] c := db.GetContainer(hostname) status := make(chan string) go manager.Kill(&c, status) <-status // block until the status updates fmt.Fprintln(w, c.Serialize()) }
func ListContainer(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) hostname := vars["hostname"] c := db.GetContainer(hostname) fmt.Fprintln(w, c.Serialize()) }