psu/client/utils.go
Juan Carlos Mejías Rodríguez eaf7d2e5cf Enhance Portainer API error handling
2019-11-26 23:27:15 -05:00

18 lines
390 B
Go

package client
import (
portainer "github.com/portainer/portainer/api"
)
// GetTranslatedStackType returns a stack's Type field (int) translated to it's human readable form (string)
func GetTranslatedStackType(t portainer.StackType) string {
switch t {
case portainer.DockerSwarmStack:
return "swarm"
case portainer.DockerComposeStack:
return "compose"
default:
return ""
}
}