package apiresources
import "k8s.io/kubectl/pkg/cmd/apiresources"
Index ¶
- func NewCmdAPIResources(restClientGetter genericclioptions.RESTClientGetter, ioStreams genericiooptions.IOStreams) *cobra.Command
- func NewCmdAPIVersions(restClientGetter genericclioptions.RESTClientGetter, ioStreams genericiooptions.IOStreams) *cobra.Command
- type APIResourceOptions
- func NewAPIResourceOptions(ioStreams genericiooptions.IOStreams) *APIResourceOptions
- func (o *APIResourceOptions) Complete(restClientGetter genericclioptions.RESTClientGetter, cmd *cobra.Command, args []string) error
- func (o *APIResourceOptions) RunAPIResources() error
- func (o *APIResourceOptions) Validate() error
- type APIVersionsOptions
- func NewAPIVersionsOptions(ioStreams genericiooptions.IOStreams) *APIVersionsOptions
- func (o *APIVersionsOptions) Complete(restClientGetter genericclioptions.RESTClientGetter, cmd *cobra.Command, args []string) error
- func (o *APIVersionsOptions) RunAPIVersions() error
- type HumanPrintFlags
- func APIResourcesHumanReadableFlags() HumanPrintFlags
- func (f *HumanPrintFlags) AddFlags(c *cobra.Command)
- func (f *HumanPrintFlags) AllowedFormats() []string
- func (f *HumanPrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)
- type HumanReadablePrinter
- type NamePrintFlags
- func APIResourcesNewNamePrintFlags() NamePrintFlags
- func (f *NamePrintFlags) AddFlags(_ *cobra.Command)
- func (f *NamePrintFlags) AllowedFormats() []string
- func (f *NamePrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)
- type NamePrinter
- type PrintFlags
- func NewPrintFlags() *PrintFlags
- func (f *PrintFlags) AddFlags(cmd *cobra.Command)
- func (f *PrintFlags) AllowedFormats() []string
- func (f *PrintFlags) ToPrinter() (printers.ResourcePrinter, error)
- type PrintOptions
Functions ¶
func NewCmdAPIResources ¶
func NewCmdAPIResources(restClientGetter genericclioptions.RESTClientGetter, ioStreams genericiooptions.IOStreams) *cobra.Command
NewCmdAPIResources creates the `api-resources` command
func NewCmdAPIVersions ¶
func NewCmdAPIVersions(restClientGetter genericclioptions.RESTClientGetter, ioStreams genericiooptions.IOStreams) *cobra.Command
NewCmdAPIVersions creates the `api-versions` command
Types ¶
type APIResourceOptions ¶
type APIResourceOptions struct { SortBy string APIGroup string Namespaced bool Verbs []string Cached bool Categories []string genericiooptions.IOStreams PrintFlags *PrintFlags PrintObj printers.ResourcePrinterFunc // contains filtered or unexported fields }
APIResourceOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()
func NewAPIResourceOptions ¶
func NewAPIResourceOptions(ioStreams genericiooptions.IOStreams) *APIResourceOptions
NewAPIResourceOptions creates the options for APIResource
func (*APIResourceOptions) Complete ¶
func (o *APIResourceOptions) Complete(restClientGetter genericclioptions.RESTClientGetter, cmd *cobra.Command, args []string) error
Complete adapts from the command line args and validates them
func (*APIResourceOptions) RunAPIResources ¶
func (o *APIResourceOptions) RunAPIResources() error
RunAPIResources does the work
func (*APIResourceOptions) Validate ¶
func (o *APIResourceOptions) Validate() error
Validate checks to the APIResourceOptions to see if there is sufficient information run the command
type APIVersionsOptions ¶
type APIVersionsOptions struct { genericiooptions.IOStreams // contains filtered or unexported fields }
APIVersionsOptions have the data required for API versions
func NewAPIVersionsOptions ¶
func NewAPIVersionsOptions(ioStreams genericiooptions.IOStreams) *APIVersionsOptions
NewAPIVersionsOptions creates the options for APIVersions
func (*APIVersionsOptions) Complete ¶
func (o *APIVersionsOptions) Complete(restClientGetter genericclioptions.RESTClientGetter, cmd *cobra.Command, args []string) error
Complete adapts from the command line args and factory to the data required
func (*APIVersionsOptions) RunAPIVersions ¶
func (o *APIVersionsOptions) RunAPIVersions() error
RunAPIVersions does the work
type HumanPrintFlags ¶
func APIResourcesHumanReadableFlags ¶
func APIResourcesHumanReadableFlags() HumanPrintFlags
func (*HumanPrintFlags) AddFlags ¶
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 ¶
func (f *HumanPrintFlags) AllowedFormats() []string
func (*HumanPrintFlags) ToPrinter ¶
func (f *HumanPrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)
ToPrinter receives an outputFormat and returns a printer capable of handling human-readable output.
type HumanReadablePrinter ¶
type HumanReadablePrinter struct {
// contains filtered or unexported fields
}
func (HumanReadablePrinter) PrintObj ¶
type NamePrintFlags ¶
type NamePrintFlags struct{}
func APIResourcesNewNamePrintFlags ¶
func APIResourcesNewNamePrintFlags() NamePrintFlags
func (*NamePrintFlags) AddFlags ¶
func (f *NamePrintFlags) AddFlags(_ *cobra.Command)
AddFlags receives a *cobra.Command reference and binds flags related to name printing to it
func (*NamePrintFlags) AllowedFormats ¶
func (f *NamePrintFlags) AllowedFormats() []string
func (*NamePrintFlags) ToPrinter ¶
func (f *NamePrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)
ToPrinter receives an outputFormat and returns a printer capable of handling human-readable output.
type NamePrinter ¶
type NamePrinter struct{}
func (NamePrinter) PrintObj ¶
type PrintFlags ¶
type PrintFlags struct { JSONYamlPrintFlags *genericclioptions.JSONYamlPrintFlags NamePrintFlags NamePrintFlags HumanReadableFlags HumanPrintFlags NoHeaders *bool OutputFormat *string }
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) ToPrinter ¶
func (f *PrintFlags) ToPrinter() (printers.ResourcePrinter, error)
type PrintOptions ¶
PrintOptions struct defines a struct for various print options
Source Files ¶
apiresources.go apiversions.go print_flags.go
- Version
- v0.35.0-alpha.0
- Published
- Aug 7, 2025
- Platform
- js/wasm
- Imports
- 17 packages
- Last checked
- 49 minutes ago –
Tools for package owners.