mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-04 23:35:11 -04:00
Split cmd package
This commit is contained in:
parent
63898c42bf
commit
de52bf14da
36 changed files with 1875 additions and 2302 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue