restmapper

package
v0.15.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewControllerRESTMapper

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

NewControllerRESTMapper is the constructor for a ControllerRESTMapper

func NewForTest

func NewForTest(restConfig *rest.Config) (meta.RESTMapper, error)

NewForTest creates a ControllerRESTMapper, but is intended to be a common interface for use by tests.

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