Documentation ¶
Index ¶
- func New(cfg *rest.Config) (meta.RESTMapper, error)
- type ControllerRESTMapper
- func (m *ControllerRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (m *ControllerRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
- func (m *ControllerRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
- func (m *ControllerRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
- func (m *ControllerRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
- func (m *ControllerRESTMapper) ResourceSingularizer(resource string) (singular string, err error)
- func (m *ControllerRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
func (m *ControllerRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
KindFor takes a partial resource and returns the single match. Returns an error if there are multiple matches
func (*ControllerRESTMapper) KindsFor ¶
func (m *ControllerRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
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 ¶
func (m *ControllerRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
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 ¶
func (m *ControllerRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
ResourcesFor takes a partial resource and returns the list of potential resource in priority order