restmapper

package
v0.0.0-...-842e221 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewControllerRESTMapper

func NewControllerRESTMapper(cfg *rest.Config) (meta.RESTMapper, error)

NewControllerRESTMapper is the constructor for a ControllerRESTMapper

Types

type ControllerRESTMapper

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

ControllerRESTMapper is a meta.RESTMapper that is optimized for controllers. It caches results in memory, and minimizes discovery because we don't need shortnames etc in controllers. Controllers primarily need to map from GVK -> GVR.

func (*ControllerRESTMapper) KindFor

KindFor takes a partial resource and returns the single match. Returns an error if there are multiple matches

func (*ControllerRESTMapper) KindsFor

KindsFor takes a partial resource and returns the list of potential kinds in priority order

func (*ControllerRESTMapper) RESTMapping

func (m *ControllerRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)

RESTMapping identifies a preferred resource mapping for the provided group kind.

func (*ControllerRESTMapper) RESTMappings

func (m *ControllerRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)

RESTMappings returns all resource mappings for the provided group kind if no version search is provided. Otherwise identifies a preferred resource mapping for the provided version(s).

func (*ControllerRESTMapper) ResourceFor

ResourceFor takes a partial resource and returns the single match. Returns an error if there are multiple matches

func (*ControllerRESTMapper) ResourceSingularizer

func (m *ControllerRESTMapper) ResourceSingularizer(resource string) (singular string, err error)

func (*ControllerRESTMapper) ResourcesFor

ResourcesFor takes a partial resource and returns the list of potential resource in priority order

Jump to

Keyboard shortcuts

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