mirror of
https://github.com/foomo/posh-providers.git
synced 2025-10-16 12:35:41 +00:00
33 lines
710 B
Go
33 lines
710 B
Go
package gcloud
|
|
|
|
import (
|
|
"github.com/foomo/posh-providers/onepassword"
|
|
)
|
|
|
|
const (
|
|
DefaultRole string = "default"
|
|
DefaultCluster string = "default"
|
|
)
|
|
|
|
type Cluster struct {
|
|
Name string `json:"name" yaml:"name"`
|
|
FullName string `json:"fullName" yaml:"fullName"`
|
|
Region string `json:"region" yaml:"region"`
|
|
Role string `json:"role" yaml:"role"`
|
|
AccessToken *onepassword.Secret `json:"accessToken" yaml:"accessToken"`
|
|
}
|
|
|
|
func (c Cluster) DefaultFullName() string {
|
|
if c.FullName != "" {
|
|
return c.FullName
|
|
}
|
|
return c.Name
|
|
}
|
|
|
|
func (c Cluster) DefaultRole() string {
|
|
if c.Role != "" {
|
|
return c.Role
|
|
}
|
|
return DefaultRole
|
|
}
|