complex

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package complex demonstrates advanced usage with CommonOptions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueryCommand

func NewQueryCommand() cli.Command

NewQueryCommand returns a command with default options.

Types

type QueryCommand

type QueryCommand struct {
	*QueryOptions
}

QueryCommand implements Command interface. Through pointer embedding of *QueryOptions, it also satisfies Options and ComplexOptions.

func (*QueryCommand) Name

func (c *QueryCommand) Name() string

Name implements Command interface.

func (*QueryCommand) Run

func (c *QueryCommand) Run(_ *cobra.Command, args []string) error

Run implements Command interface.

type QueryOptions

type QueryOptions struct {
	cli.CommonOptions

	Resource string
	Limit    int
}

QueryOptions implements Options and ComplexOptions interfaces. By embedding CommonOptions, it inherits Workspace and Logger fields.

func (*QueryOptions) BindFlags

func (o *QueryOptions) BindFlags(fs *pflag.FlagSet)

BindFlags implements Options interface.

func (*QueryOptions) Complete

func (o *QueryOptions) Complete(cmd *cobra.Command, args []string) error

Complete implements ComplexOptions interface. MUST call embedded CommonOptions.Complete to initialize Logger.

func (*QueryOptions) Validate

func (o *QueryOptions) Validate() error

Validate implements ComplexOptions interface. MUST call embedded CommonOptions.Validate first, then add custom validation.

Jump to

Keyboard shortcuts

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