commands

package
v0.0.0-...-d827e98 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YamlConfigFlag           = "config-file"
	YamlConfigShorthandFlag  = "f"
	VersionNameFlag          = "version-name"
	VersionNameShorthandFlag = "s"
)
View Source
const (
	ConfirmFlag = "confirm-delete"
)
View Source
const (
	DownloadIstioCTLVersion = "version"
)
View Source
const (
	DryRunFlag = "dry-run"
)

Variables

View Source
var DryRun bool

Functions

func AddYamlConfigFlag

func AddYamlConfigFlag(cmd *cobra.Command, flagHelp string)

func AddYamlConfigFlagVar

func AddYamlConfigFlagVar(ptr *string, cmd *cobra.Command, flagHelp string)

Types

type ApplyOnAllOptions

type ApplyOnAllOptions struct {
	YamlConfigFilePath string
	DryRun             bool
	// contains filtered or unexported fields
}

describe ApplyOnAllOptions ApplyOnAllOptions is the struct to hold the options for apply command YamlConfigFilePath is the path to the YAML file containing the resources to apply DryRun is the flag to indicate if the apply operation should be a dry run logger is the logger instance

func (*ApplyOnAllOptions) AddFlags

func (o *ApplyOnAllOptions) AddFlags(cmd *cobra.Command)

func (*ApplyOnAllOptions) Run

func (o *ApplyOnAllOptions) Run(cmd *cobra.Command, args []string) error

describe Run Run is the function to run the apply command cmd is the cobra command instance args is the list of arguments returns error

func (*ApplyOnAllOptions) Validate

func (o *ApplyOnAllOptions) Validate(cmd *cobra.Command, args []string) error

describe Validate Validate is the function to validate the apply command options

type CmdOptions

type CmdOptions interface {
	// Validate is used to validate arguments and flags.
	// The function will validate args without calling REST APIs.
	// This means validating if files exist, if there are duplicate arguments provided,
	// if the proper flags are provided, etc.
	// It is also where config files are parsed
	Validate(cmd *cobra.Command, args []string) error
	// Run runs the command action
	Run(cmd *cobra.Command, args []string) error
	// AddFlags adds flags to the supplied cobra command
	AddFlags(cmd *cobra.Command)
}

func NewApplyOnAllOptions

func NewApplyOnAllOptions(logger log.Logger) CmdOptions

func NewDeleteOnAllOptions

func NewDeleteOnAllOptions(logger log.Logger) CmdOptions

type DeleteOnAllOptions

type DeleteOnAllOptions struct {
	YamlConfigFilePath string
	Yes                bool
	// contains filtered or unexported fields
}

flagpole

func (*DeleteOnAllOptions) AddFlags

func (o *DeleteOnAllOptions) AddFlags(cmd *cobra.Command)

func (*DeleteOnAllOptions) Run

func (o *DeleteOnAllOptions) Run(cmd *cobra.Command, args []string) error

func (*DeleteOnAllOptions) Validate

func (o *DeleteOnAllOptions) Validate(cmd *cobra.Command, args []string) error

type DownloadIstioCTLOptions

type DownloadIstioCTLOptions struct {
	Version        string
	DownloadFolder string
	// contains filtered or unexported fields
}

func NewDownloadIstioCTLOptions

func NewDownloadIstioCTLOptions(logger log.Logger) *DownloadIstioCTLOptions

func (*DownloadIstioCTLOptions) AddFlags

func (c *DownloadIstioCTLOptions) AddFlags(cmd *cobra.Command)

func (*DownloadIstioCTLOptions) Run

func (c *DownloadIstioCTLOptions) Run(cmd *cobra.Command, args []string) error

func (*DownloadIstioCTLOptions) Validate

func (c *DownloadIstioCTLOptions) Validate(cmd *cobra.Command, args []string) error

type GlobalOptions

type GlobalOptions struct {
	Verbose,
	Debug bool
	Output bool
	// contains filtered or unexported fields
}

GlobalOptions is a struct to hold the values for global options

func NewGlobalOptions

func NewGlobalOptions(log log.Logger) *GlobalOptions

func (*GlobalOptions) AddFlags

func (g *GlobalOptions) AddFlags(cmd *cobra.Command)

func (*GlobalOptions) Run

func (g *GlobalOptions) Run(cmd *cobra.Command, _ []string) error

func (*GlobalOptions) Validate

func (g *GlobalOptions) Validate(_ *cobra.Command, _ []string) error

Jump to

Keyboard shortcuts

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