api/platform.go
func platformInfo(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	name := r.URL.Query().Get(":name")
	canUsePlat := permission.Check(t, permission.PermPlatformUpdate) ||
		permission.Check(t, permission.PermPlatformCreate)
	if !canUsePlat {
		return permission.ErrUnauthorized
	}
	platform, err := servicemanager.Platform.FindByName(name)
	if err == appTypes.ErrPlatformNotFound {
		return &tErrors.HTTP{Code: http.StatusNotFound, Message: err.Error()}
	}
	if err != nil {
		return err
	}
	images, err := servicemanager.PlatformImage.ListImagesOrDefault(name)
	if err != nil {
		return err
	}
	msg := map[string]interface{}{
		"platform": platform,
		"images":   images,
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(msg)
}
func platformInfo(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	name := r.URL.Query().Get(":name")
	canUsePlat := permission.Check(t, permission.PermPlatformUpdate) ||
		permission.Check(t, permission.PermPlatformCreate)
	if !canUsePlat {
		return permission.ErrUnauthorized
	}
	platform, err := servicemanager.Platform.FindByName(name)
	if err == appTypes.ErrPlatformNotFound {
		return &tErrors.HTTP{Code: http.StatusNotFound, Message: err.Error()}
	}
	if err != nil {
		return err
	}
	images, err := servicemanager.PlatformImage.ListImagesOrDefault(name)
	if err != nil {
		return err
	}
	msg := map[string]interface{}{
		"platform": platform,
		"images":   images,
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(msg)
}
// title: platform info
// path: /platforms/{name}
// method: GET
// produce: application/json
// responses:
//   200: Platform info
//   401: Unauthorized
//   404: NotFound