formats

package
v0.0.0-...-7c966ab Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatBundle

type FormatBundle struct {
	ByAlias     map[string][]*FormatContainer
	ByGroupKind map[schema.GroupKind][]*FormatContainer
	ByName      map[string]*FormatContainer
	SearchPaths []string
}

func LoadPaths

func LoadPaths(sch *runtime.Scheme, paths []string) (*FormatBundle, error)

func (*FormatBundle) ToPrinter

func (fb *FormatBundle) ToPrinter(mapping *meta.RESTMapping, opts Options) (cliprinters.ResourcePrinterFunc, error)

ToPrinter selects the best resource printer based on GVK and formatting options.

type FormatContainer

type FormatContainer struct {
	*v1alpha1.ShowFormat
	runtime.Decoder

	Path string
	// contains filtered or unexported fields
}

func (*FormatContainer) ToPrinter

type NoCompatibleConfigError

type NoCompatibleConfigError struct {
	GroupKind      schema.GroupKind
	AllowedFormats []string
	Paths          []string
}

func (NoCompatibleConfigError) Error

func (e NoCompatibleConfigError) Error() string

type Options

type Options struct {
	// AllowedFormats is a map of allowed formats. The value is ignored.
	AllowedFormats map[string]bool
	// NoHeaders is whether headers should be printed or not.
	NoHeaders bool
}

Options captures formatting options.

func (Options) Allows

func (opts Options) Allows(fc *FormatContainer) bool

Allows returns whether the format container is allowed by options or not.

Jump to

Keyboard shortcuts

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