func ServiceList(rw http.ResponseWriter, r *http.Request) { log := servicesLogger("list").Start() services, err := models.ListServiceStacks() if err != nil { helpers.Error(log, err) RenderError(rw, err) return } RenderJson(rw, services) }
func ServiceNameList(rw http.ResponseWriter, r *http.Request) { log := servicesLogger("nameList").Start() t := mux.Vars(r)["type"] services, err := models.ListServiceStacks() if err != nil { helpers.Error(log, err) RenderError(rw, err) return } s := models.Services{} for _, item := range services { if item.Tags["Service"] == t { s = append(s, item) } } RenderPartial(rw, "services", "names", s) }