Documentation
¶
Overview ¶
Package options implements the generic logic to manage the common options shared by all the falcoctl commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactOptions ¶
type ArtifactOptions struct { ArtifactType oci.ArtifactType Platforms []string // orders matter (same as args) Dependencies []string Tags []string AnnotationSource string }
ArtifactOptions artifact specific options. Commands that need these options may embed this struct in their options.
func (*ArtifactOptions) AddFlags ¶
func (art *ArtifactOptions) AddFlags(cmd *cobra.Command) error
AddFlags registers the artifacts flags.
func (*ArtifactOptions) OSArch ¶
func (art *ArtifactOptions) OSArch(index int) (os, arch string)
OSArch returns the OS and the ARCH of the platform at index-th position.
func (*ArtifactOptions) Validate ¶
func (art *ArtifactOptions) Validate() error
Validate validates the options passed by the user.
type CommonOptions ¶
type CommonOptions struct { // Printer used by all commands to output messages. Printer *output.Printer // contains filtered or unexported fields }
CommonOptions provides the common flags, options, and printers for all the commands. All the fields provided by the CommonOptions will be initialized before the commands are executed through the Initialize func.
func (*CommonOptions) AddFlags ¶
func (o *CommonOptions) AddFlags(flags *pflag.FlagSet)
AddFlags registers the common flags.
func (*CommonOptions) Initialize ¶
func (o *CommonOptions) Initialize(cfgs ...Configs)
Initialize initializes the options based on the configs. Subsequent calls will overwrite the previous configurations based on the new configs passed to the functions.
type Configs ¶
type Configs func(options *CommonOptions)
Configs type of the configs accepted by the Initialize function.
func WithPrinterScope ¶
WithPrinterScope sets the scope for the printer.
func WithWriter ¶
WithWriter sets the writer for the printer.