Documentation ¶
Index ¶
- Variables
- func BoolEnvDef(env string, def bool) bool
- func ExpandPath(path string) string
- func IntEnvDef(env string, def int) int
- func StrEnvDef(env string, def string) string
- type ApplyOptions
- type AwsOptions
- type CRDOptions
- type CreateOptions
- type DeleteOptions
- type DeployControllerOptions
- type EditOptions
- type ExplainOptions
- type GetConfigOptions
- type ListOptions
- type Options
- type ProfileFunc
- type ProfileMap
- type StateStoreOptions
- type VersionOptions
Constants ¶
This section is empty.
Variables ¶
var ( // P helps format usage details P = func() string { str := "" spaces := "" maxLen := 0 for shorthand := range ProfileMapIndexed { l := len(shorthand) if l > maxLen { maxLen = l } } for _, shorthand := range sortedKeys(ProfileMapIndexed) { spaces = "" k := math.Abs(float64(maxLen) - float64(len(shorthand)) + 3) for i := 0; i < int(k); i++ { spaces = fmt.Sprintf("%s%s", spaces, " ") } str = fmt.Sprintf("%s %s%s %s\n", str, shorthand, spaces, ProfileMapIndexed[shorthand].Description) } return str }() // UsageTemplate is a template for showing usage UsageTemplate = fmt.Sprintf(`Usage:{{if .Runnable}} {{if .HasAvailableFlags}}{{appendIfNotPresent .UseLine "[flags]"}}{{else}}{{.UseLine}}{{end}}{{end}}{{if .HasAvailableSubCommands}} {{ .CommandPath}} [command]{{end}} Profiles: %s{{if gt .Aliases 0}} Aliases: {{.NameAndAliases}} {{end}}{{if .HasExample}} Examples: {{ .Example }}{{end}}{{ if .HasAvailableSubCommands}} Available Commands:{{range .Commands}}{{if .IsAvailableCommand}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{ if .HasAvailableLocalFlags}} Flags: {{.LocalFlags.FlagUsages | trimRightSpace}}{{end}}{{ if .HasAvailableInheritedFlags}} Global Flags: {{.InheritedFlags.FlagUsages | trimRightSpace}}{{end}}{{if .HasHelpSubCommands}} Additional help topics:{{range .Commands}}{{if .IsHelpCommand}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{ if .HasAvailableSubCommands }} Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} `, P) )
var ProfileMapIndexed = map[string]ProfileMap{ "azure": { ProfileFunc: azure.NewUbuntuCluster, Description: "Ubuntu on Azure", }, "azure-ubuntu": { ProfileFunc: azure.NewUbuntuCluster, Description: "Ubuntu on Azure", }, "amazon": { ProfileFunc: amazon.NewUbuntuCluster, Description: "Ubuntu on Amazon", }, "aws": { ProfileFunc: amazon.NewUbuntuCluster, Description: "Ubuntu on Amazon", }, "do": { ProfileFunc: digitalocean.NewUbuntuCluster, Description: "Ubuntu on DigitalOcean", }, "google": { ProfileFunc: googlecompute.NewUbuntuCluster, Description: "Ubuntu on Google Compute", }, "digitalocean": { ProfileFunc: digitalocean.NewUbuntuCluster, Description: "Ubuntu on DigitalOcean", }, "do-ubuntu": { ProfileFunc: digitalocean.NewUbuntuCluster, Description: "Ubuntu on DigitalOcean", }, "aws-ubuntu": { ProfileFunc: amazon.NewUbuntuCluster, Description: "Ubuntu on Amazon", }, "do-centos": { ProfileFunc: digitalocean.NewCentosCluster, Description: "CentOS on DigitalOcean", }, "aws-centos": { ProfileFunc: amazon.NewCentosCluster, Description: "CentOS on Amazon", }, "aws-debian": { ProfileFunc: amazon.NewDebianCluster, Description: "Debian on Amazon", }, "ovh": { ProfileFunc: ovh.NewUbuntuCluster, Description: "Ubuntu on OVH", }, "ovh-ubuntu": { ProfileFunc: ovh.NewUbuntuCluster, Description: "Ubuntu on OVH", }, "packet": { ProfileFunc: packet.NewUbuntuCluster, Description: "Ubuntu on Packet x86", }, "packet-ubuntu": { ProfileFunc: packet.NewUbuntuCluster, Description: "Ubuntu on Packet x86", }, "ecs": { ProfileFunc: ecs.NewUbuntuCluster, Description: "Ubuntu on ECS", }, "ecs-ubuntu": { ProfileFunc: ecs.NewUbuntuCluster, Description: "Ubuntu on ECS", }, "controller-aws-ubuntu": { ProfileFunc: amazon.NewControllerUbuntuCluster, Description: "Controller Ubuntu on Amazon", }, "caws": { ProfileFunc: amazon.NewControllerUbuntuCluster, Description: "Controller Ubuntu on Amazon", }, "controller-do-ubuntu": { ProfileFunc: digitalocean.NewControllerUbuntuCluster, Description: "Controller Ubuntu on DigitalOcean", }, "cdo": { ProfileFunc: digitalocean.NewControllerUbuntuCluster, Description: "Controller Ubuntu on DigitalOcean", }, }
ProfileMapIndexed is a map of possible profiles
Functions ¶
func BoolEnvDef ¶
BoolEnvDef get environemnt variable and return bool.
Types ¶
type ApplyOptions ¶
type ApplyOptions struct {
Options
}
ApplyOptions represents apply command options.
type AwsOptions ¶
type AwsOptions struct { S3AccessKey string S3SecretKey string BucketEndpointURL string BucketSSL bool BucketName string }
AWS Options
type CRDOptions ¶
type CRDOptions struct {
Options
}
CRDOptions represents getConfig command options.
type CreateOptions ¶
CreateOptions represents create command options.
type DeleteOptions ¶
DeleteOptions represents delete command options.
type DeployControllerOptions ¶
type DeployControllerOptions struct {
Options
}
DeployControllerOptions represents getConfig command options.
type EditOptions ¶
EditOptions represents edit command options.
type ExplainOptions ¶
ExplainOptions represents explain command options.
type GetConfigOptions ¶
type GetConfigOptions struct {
Options
}
GetConfigOptions represents getConfig command options.
type ListOptions ¶
ListOptions represents list command options.
type Options ¶
type Options struct { StateStoreOptions Name string CloudID string Set string AwsProfile string GitRemote string AwsOptions }
Options represents command options.
func (Options) NewStateStore ¶
func (options Options) NewStateStore() (state.ClusterStorer, error)
NewStateStore returns clusterStorer object based on type.
type ProfileFunc ¶
ProfileFunc represents function type for a profile
type ProfileMap ¶
type ProfileMap struct { ProfileFunc ProfileFunc Description string }
ProfileMap object representing profile function and a description
type StateStoreOptions ¶
StateStoreOptions