cli: kubedb.dev/cli/pkg/cmds/get Index | Files

package get

import "kubedb.dev/cli/pkg/cmds/get"

Index

Package Files

flags.go get.go humanreadable_flags.go

func NewCmdGet Uses

func NewCmdGet(parent string, f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

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

type GetOptions Uses

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

    CmdParent string

    resource.FilenameOptions

    Raw       string
    Watch     bool
    WatchOnly bool
    ChunkSize int64

    LabelSelector     string
    FieldSelector     string
    AllNamespaces     bool
    Namespace         string
    ExplicitNamespace bool

    ServerPrint bool

    NoHeaders      bool
    Sort           bool
    IgnoreNotFound bool
    Export         bool

    genericclioptions.IOStreams
}

GetOptions contains the input to the get command.

func NewGetOptions Uses

func NewGetOptions(parent string, streams genericclioptions.IOStreams) *GetOptions

NewGetOptions returns a GetOptions with default chunk size 500.

func (*GetOptions) Complete Uses

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

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

func (*GetOptions) Run Uses

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

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

func (*GetOptions) Validate Uses

func (o *GetOptions) Validate(cmd *cobra.Command) error

Validate checks the set of flags provided by the user.

type HumanPrintFlags Uses

type HumanPrintFlags struct {
    ShowKind     *bool
    ShowLabels   *bool
    SortBy       *string
    ColumnLabels *[]string

    // get.go-specific values
    NoHeaders bool

    Kind               schema.GroupKind
    AbsoluteTimestamps bool
    WithNamespace      bool
}

HumanPrintFlags provides default flags necessary for printing. Given the following flag values, a printer can be requested that knows how to handle printing based on these values.

func NewHumanPrintFlags Uses

func NewHumanPrintFlags() *HumanPrintFlags

NewHumanPrintFlags returns flags associated with human-readable printing, with default values set.

func (*HumanPrintFlags) AddFlags Uses

func (f *HumanPrintFlags) AddFlags(c *cobra.Command)

AddFlags receives a *cobra.Command reference and binds flags related to human-readable printing to it

func (*HumanPrintFlags) AllowedFormats Uses

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

func (*HumanPrintFlags) EnsureWithKind Uses

func (f *HumanPrintFlags) EnsureWithKind() error

EnsureWithKind sets the "Showkind" humanreadable option to true.

func (*HumanPrintFlags) EnsureWithNamespace Uses

func (f *HumanPrintFlags) EnsureWithNamespace() error

EnsureWithNamespace sets the "WithNamespace" humanreadable option to true.

func (*HumanPrintFlags) SetKind Uses

func (f *HumanPrintFlags) SetKind(kind schema.GroupKind)

SetKind sets the Kind option

func (*HumanPrintFlags) ToPrinter Uses

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

ToPrinter receives an outputFormat and returns a printer capable of handling human-readable output.

type NopPositioner Uses

type NopPositioner struct{}

func (*NopPositioner) OriginalPosition Uses

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

type OriginalPositioner Uses

type OriginalPositioner interface {
    OriginalPosition(int) int
}

type PrintFlags Uses

type PrintFlags struct {
    JSONYamlPrintFlags *genericclioptions.JSONYamlPrintFlags
    NamePrintFlags     *genericclioptions.NamePrintFlags
    CustomColumnsFlags *getflags.CustomColumnsPrintFlags
    HumanReadableFlags *HumanPrintFlags
    TemplateFlags      *genericclioptions.KubeTemplatePrintFlags

    NoHeaders    *bool
    OutputFormat *string
}

PrintFlags composes common printer flag structs used in the Get command.

func NewGetPrintFlags Uses

func NewGetPrintFlags() *PrintFlags

NewGetPrintFlags returns flags associated with humanreadable, template, and "name" printing, with default values set.

func (*PrintFlags) AddFlags Uses

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

AddFlags receives a *cobra.Command reference and binds flags related to humanreadable and template printing.

func (*PrintFlags) AllowedFormats Uses

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

func (*PrintFlags) Copy Uses

func (f *PrintFlags) Copy() PrintFlags

Copy returns a copy of PrintFlags for mutation

func (*PrintFlags) EnsureWithKind Uses

func (f *PrintFlags) EnsureWithKind() error

EnsureWithKind ensures that humanreadable flags return a printer capable of including resource kinds.

func (*PrintFlags) EnsureWithNamespace Uses

func (f *PrintFlags) EnsureWithNamespace() error

EnsureWithNamespace ensures that humanreadable flags return a printer capable of printing with a "namespace" column.

func (*PrintFlags) SetKind Uses

func (f *PrintFlags) SetKind(kind schema.GroupKind)

SetKind sets the Kind option of humanreadable flags

func (*PrintFlags) ToPrinter Uses

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

ToPrinter attempts to find a composed set of PrintFlags suitable for returning a printer based on current flag values.

func (*PrintFlags) UseOpenAPIColumns Uses

func (f *PrintFlags) UseOpenAPIColumns(api openapi.Resources, mapping *meta.RESTMapping) error

UseOpenAPIColumns modifies the output format, as well as the "allowMissingKeys" option for template getflags, to values defined in the OpenAPI schema of a resource.

type RuntimeSorter Uses

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

func NewRuntimeSorter Uses

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

func (*RuntimeSorter) OriginalPosition Uses

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

func (*RuntimeSorter) Sort Uses

func (r *RuntimeSorter) Sort() error

func (*RuntimeSorter) WithDecoder Uses

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

allows custom decoder to be set for testing

Package get imports 34 packages (graph) and is imported by 1 packages. Updated 2019-08-05. Refresh now. Tools for package owners.