get

package
v0.0.0-...-5c15dd9 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

nolint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd(parent string, f cmdutil.Factory, configFlags *genericclioptions.ConfigFlags,
	streams genericclioptions.IOStreams, mapping *meta.RESTMapping, resourcePath, resourceNamePlural string) *cobra.Command

NewCmd creates a command object for the generic "get" action, which retrieves one or more resources from a server.

Types

type NopPositioner

type NopPositioner struct{}

NopPositioner and OriginalPositioner is required for swap/sort operations of data in table format

func (*NopPositioner) OriginalPosition

func (t *NopPositioner) OriginalPosition(ix int) int

OriginalPosition returns the original position from NopPositioner object

type Options

type Options struct {
	PrintFlags             *kubectlget.PrintFlags
	ToPrinter              func(*meta.RESTMapping, *bool, bool, bool) (printers.ResourcePrinterFunc, error)
	IsHumanReadablePrinter bool
	PrintWithOpenAPICols   bool

	CmdParent string

	resource.FilenameOptions

	Watch     bool
	ChunkSize int64

	OutputWatchEvents bool

	LabelSelector string
	FieldSelector string

	ServerPrint bool

	NoHeaders      bool
	Sort           bool
	IgnoreNotFound bool

	genericclioptions.IOStreams
	// contains filtered or unexported fields
}

Options contains the input to the get command.

func NewOptions

func NewOptions(parent string, configFlags *genericclioptions.ConfigFlags,
	streams genericclioptions.IOStreams, mapping *meta.RESTMapping,
	resourcePath string) *Options

NewOptions returns a Options with default chunk size 500.

func (*Options) Complete

func (o *Options) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

Complete takes the command arguments and factory and infers any remaining options.

func (*Options) Run

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

Run performs the get operation. TODO: remove the need to pass these arguments, like other commands.

func (*Options) Validate

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

Validate checks the set of flags provided by the user.

type OriginalPositioner

type OriginalPositioner interface {
	OriginalPosition(int) int
}

OriginalPositioner and NopPositioner is required for swap/sort operations of data in table format

type RuntimeSorter

type RuntimeSorter struct {
	// contains filtered or unexported fields
}

RuntimeSorter holds the required objects to perform sorting of runtime objects

func NewRuntimeSorter

func NewRuntimeSorter(objects []runtime.Object, sortBy string) *RuntimeSorter

NewRuntimeSorter returns a new instance of RuntimeSorter

func (*RuntimeSorter) OriginalPosition

func (r *RuntimeSorter) OriginalPosition(ix int) int

OriginalPosition returns the original position of a runtime object

func (*RuntimeSorter) Sort

func (r *RuntimeSorter) Sort() error

Sort performs the sorting of runtime objects

func (*RuntimeSorter) WithDecoder

func (r *RuntimeSorter) WithDecoder(decoder runtime.Decoder) *RuntimeSorter

WithDecoder allows custom decoder to be set for testing

Jump to

Keyboard shortcuts

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