cmd

package
v1.85.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2025 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZoneFlagLong  = "zone"
	ZoneFlagShort = "z"
	ZoneFlagMsg   = "bucket zone"
)
View Source
const (
	DefaultInstanceType       = "medium"
	DefaultInstanceTypeFamily = "standard"

	DefaultTemplateVisibility = "public"
)
View Source
const (
	// Daytime of the night
	Daytime port = 13
	// FTP protocol port number
	FTP port = 21
	// SSH protocol port number
	SSH port = 22
	// Telnet protocol port number
	Telnet port = 23
	// SMTP protocol port number
	SMTP port = 25
	// Time protocol port number
	Time port = 37
	// Whois protocol port number
	Whois port = 43
	// DNS protocol port number
	DNS port = 53
	// TFTP protocol port number
	TFTP port = 69
	// Gopher protocol port number
	Gopher port = 70
	// HTTP protocol port number
	HTTP port = 80
	// Kerberos protocol port number
	Kerberos port = 88
	// Nic protocol port number
	Nic port = 101
	// SFTP protocol port number
	SFTP port = 115
	// NTP protocol port number
	NTP port = 123
	// IMAP protocol port number
	IMAP port = 143
	// SNMP protocol port number
	SNMP port = 161
	// IRC protocol port number
	IRC port = 194
	// HTTPS protocol port number
	HTTPS port = 443
	// Docker protocol port number
	Docker port = 2376
	// RDP protocol port number
	RDP port = 3389
	// Minecraft protocol port number
	Minecraft port = 25565
)
View Source
const CmdFlagForceHelp = "attempt to perform the operation without prompting for confirmation"

Variables

View Source
var ComputeCmd = &cobra.Command{
	Use:        "compute",
	Short:      "Compute services management",
	Aliases:    []string{"c"},
	SuggestFor: []string{"vm", "aag", "firewall", "instancepool", "nlb"},
}
View Source
var GCommit string
View Source
var GContext context.Context
View Source
var GCreateAlias = []string{"add"}
View Source
var GDeleteAlias = []string{"del"}
View Source
var GListAlias = []string{"ls"}

Aliases

View Source
var GRemoveAlias = []string{"rm"}
View Source
var GShowAlias = []string{"get"}
View Source
var GVersion string
View Source
var RootCmd = &cobra.Command{
	Use:           "exo",
	Short:         "Manage your Exoscale infrastructure easily",
	SilenceUsage:  true,
	SilenceErrors: true,
}

Functions

func CliCommandDefaultPreRun added in v1.85.0

func CliCommandDefaultPreRun(c cliCommand, cmd *cobra.Command, args []string) error

CliCommandDefaultPreRun is a convenience helper function that can be used in cliCommand.cmdPreRun() hooks to automagically retrieve values for the struct flags/args fields from a cobra.Command and args provided, and set corresponding fields on the struct implementing the cliCommand interface.

func CmdCheckRequiredFlags added in v1.85.1

func CmdCheckRequiredFlags(cmd *cobra.Command, flags []string) error

CmdCheckRequiredFlags evaluates the specified flags as parsed in the cobra.Command flagset to check that their value is unset (i.e. null/empty/zero, depending on the type), and returns a multierror listing all flags missing a required value.

func CmdExitOnUsageError added in v1.85.0

func CmdExitOnUsageError(cmd *cobra.Command, reason string)

func CmdSetTemplateFlagFromDefault added in v1.85.0

func CmdSetTemplateFlagFromDefault(cmd *cobra.Command)

CmdSetTemplateFlagFromDefault attempts to set the "--template" flag value based on the current active account's default template setting if set. This is a convenience helper, there is no guarantee that the flag will be set once this function returns.

func CmdSetZoneFlagFromDefault added in v1.85.0

func CmdSetZoneFlagFromDefault(cmd *cobra.Command)

CmdSetZoneFlagFromDefault attempts to set the "--zone" flag value based on the current active account's default zone setting if set. This is a convenience helper, there is no guarantee that the flag will be set once this function returns.

func CmdShowHelpFlags added in v1.85.0

func CmdShowHelpFlags(flags *pflag.FlagSet, prefix string)

CmdShowHelpFlags outputs flags matching the specified prefix in the provided flag set. This can be used for example to craft specialized usage help messages for hidden flags.

func ConvertIfSpecialEmptyMap added in v1.85.0

func ConvertIfSpecialEmptyMap(m map[string]string) map[string]string

func DatePtrFormatOutput added in v1.58.0

func DatePtrFormatOutput(t *time.Time) string

func Execute

func Execute(version, commit string)

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.

func Int64PtrFormatOutput added in v1.55.0

func Int64PtrFormatOutput(n *int64) string

func MustCLICommandFlagName added in v1.85.0

func MustCLICommandFlagName(c cliCommand, field interface{}) string

func RegisterCLICommand added in v1.85.0

func RegisterCLICommand(parent *cobra.Command, c cliCommand) error

RegisterCLICommand registers the specified cliCommand instance to the current CLI framework (currently Cobra).

func StrPtrFormatOutput added in v1.58.0

func StrPtrFormatOutput(s *string) string

func SwitchClientZoneV3 added in v1.85.0

func SwitchClientZoneV3(ctx context.Context, client *v3.Client, zone v3.ZoneName) (*v3.Client, error)

Types

type CliCommandSettings added in v1.85.0

type CliCommandSettings struct {
	OutputFunc func(o output.Outputter, err error) error
}

CliCommandSettings represents a CLI command settings.

func DefaultCLICmdSettings added in v1.85.0

func DefaultCLICmdSettings() CliCommandSettings

DefaultCLICmdSettings returns a cliCommandSettings struct initialized with default values.

type LimitsItemOutput

type LimitsItemOutput struct {
	Resource string `json:"resource"`
	Used     int64  `json:"used"`
	Max      int64  `json:"max"`
}

type LimitsOutput

type LimitsOutput []LimitsItemOutput

func (*LimitsOutput) ToJSON added in v1.68.0

func (o *LimitsOutput) ToJSON()

func (*LimitsOutput) ToTable added in v1.68.0

func (o *LimitsOutput) ToTable()

func (*LimitsOutput) ToText added in v1.68.0

func (o *LimitsOutput) ToText()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL