mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
18 lines
390 B
Go
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 ""
|
|
}
|
|
}
|