util

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map added in v0.2.0

func Map[S ~[]E, E any](s S, fn func(e E) E) S

Map applies the given function to all slice elements.

Types

type Factory

type Factory interface {
	cmdutil.Factory
	// Client returns a new controller-runtime client.
	Client() (client.Client, error)
}

Factory augments the Factory interface for creating controller-runtime clients.

func NewFactory

func NewFactory(clientGetter genericclioptions.RESTClientGetter) Factory

NewFactory creates a new factory based on the given configuration.

type PrintFlags

type PrintFlags struct {
	*genericclioptions.PrintFlags
	CustomColumnsFlags *kubectlget.CustomColumnsPrintFlags
	TableFlags         *TablePrintFlags

	TemplateOnly bool
}

PrintFlags composes common output-related flags used in multiple commands.

func NewPrintFlags

func NewPrintFlags() *PrintFlags

func (*PrintFlags) AddFlags

func (f *PrintFlags) AddFlags(cmd *cobra.Command)

func (*PrintFlags) AllowedFormats

func (f *PrintFlags) AllowedFormats() []string

func (*PrintFlags) OutputUsage

func (f *PrintFlags) OutputUsage() string

OutputUsage returns the descriptions for the --output flag based on what is available for the active command.

func (*PrintFlags) SetWithNamespace added in v0.4.0

func (f *PrintFlags) SetWithNamespace()

func (*PrintFlags) ToPrinter

func (f *PrintFlags) ToPrinter() (printers.ResourcePrinter, error)

ToPrinter returns a printer capable of handling the specified output format. History objects (e.g., Revision and Revisions) can be directly passed to the returned printer.

type TablePrintFlags

type TablePrintFlags struct {
	NoHeaders    *bool
	ShowLabels   *bool
	ColumnLabels []string

	WithNamespace bool
}

func NewTablePrintFlags

func NewTablePrintFlags() *TablePrintFlags

func (*TablePrintFlags) AddFlags

func (f *TablePrintFlags) AddFlags(cmd *cobra.Command)

func (*TablePrintFlags) AllowedFormats

func (f *TablePrintFlags) AllowedFormats() []string

func (*TablePrintFlags) SetWithNamespace added in v0.4.0

func (f *TablePrintFlags) SetWithNamespace()

func (*TablePrintFlags) ToPrinter

func (f *TablePrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)

Jump to

Keyboard shortcuts

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