Documentation
¶
Index ¶
- Constants
- Variables
- func CliCommandDefaultPreRun(c cliCommand, cmd *cobra.Command, args []string) error
- func CmdCheckRequiredFlags(cmd *cobra.Command, flags []string) error
- func CmdExitOnUsageError(cmd *cobra.Command, reason string)
- func CmdSetTemplateFlagFromDefault(cmd *cobra.Command)
- func CmdSetZoneFlagFromDefault(cmd *cobra.Command)
- func CmdShowHelpFlags(flags *pflag.FlagSet, prefix string)
- func ConvertIfSpecialEmptyMap(m map[string]string) map[string]string
- func DatePtrFormatOutput(t *time.Time) string
- func Execute(version, commit string)
- func Int64PtrFormatOutput(n *int64) string
- func MustCLICommandFlagName(c cliCommand, field interface{}) string
- func RegisterCLICommand(parent *cobra.Command, c cliCommand) error
- func StrPtrFormatOutput(s *string) string
- func SwitchClientZoneV3(ctx context.Context, client *v3.Client, zone v3.ZoneName) (*v3.Client, error)
- type CliCommandSettings
- type LimitsItemOutput
- type LimitsOutput
Constants ¶
const ( ZoneFlagLong = "zone" ZoneFlagShort = "z" ZoneFlagMsg = "bucket zone" )
const ( DefaultInstanceType = "medium" DefaultInstanceTypeFamily = "standard" DefaultTemplateVisibility = "public" )
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 )
const CmdFlagForceHelp = "attempt to perform the operation without prompting for confirmation"
Variables ¶
var ComputeCmd = &cobra.Command{ Use: "compute", Short: "Compute services management", Aliases: []string{"c"}, SuggestFor: []string{"vm", "aag", "firewall", "instancepool", "nlb"}, }
var GCommit string
var GContext context.Context
var GCreateAlias = []string{"add"}
var GDeleteAlias = []string{"del"}
var GListAlias = []string{"ls"}
Aliases
var GRemoveAlias = []string{"rm"}
var GShowAlias = []string{"get"}
var GVersion string
var RootCmd = &cobra.Command{ Use: "exo", Short: "Manage your Exoscale infrastructure easily", SilenceUsage: true, SilenceErrors: true, }
Functions ¶
func CliCommandDefaultPreRun ¶ added in v1.85.0
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
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 CmdSetTemplateFlagFromDefault ¶ added in v1.85.0
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
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
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 DatePtrFormatOutput ¶ added in v1.58.0
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 MustCLICommandFlagName ¶ added in v1.85.0
func MustCLICommandFlagName(c cliCommand, field interface{}) string
func RegisterCLICommand ¶ added in v1.85.0
RegisterCLICommand registers the specified cliCommand instance to the current CLI framework (currently Cobra).
func StrPtrFormatOutput ¶ added in v1.58.0
Types ¶
type CliCommandSettings ¶ added in v1.85.0
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 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()
Source Files
¶
- client.go
- cmd.go
- common.go
- compute.go
- config.go
- config_add.go
- config_delete.go
- config_list.go
- config_set.go
- config_show.go
- dns.go
- dns_add.go
- dns_create.go
- dns_delete.go
- dns_list.go
- dns_records_add.go
- dns_records_update.go
- dns_remove.go
- dns_show.go
- dns_update.go
- environment.go
- icmp_code.go
- icmp_type.go
- icmpcode_string.go
- icmptype_string.go
- integration_fig.go
- integrations.go
- limits.go
- output.go
- port.go
- port_string.go
- root.go
- status.go
- x.go
- zone.go