Split cmd package

This commit is contained in:
katexochen 2022-04-13 13:01:38 +02:00 committed by Paul Meyer
parent 63898c42bf
commit de52bf14da
36 changed files with 1875 additions and 2302 deletions

View file

@ -1,5 +1,7 @@
package cloudprovider
import "strings"
//go:generate stringer -type=CloudProvider
// CloudProvider is cloud provider used by the CLI.
@ -11,3 +13,18 @@ const (
Azure
GCP
)
// FromString returns cloud provider from string.
func FromString(s string) CloudProvider {
s = strings.ToLower(s)
switch s {
case "aws":
return AWS
case "azure":
return Azure
case "gcp":
return GCP
default:
return Unknown
}
}