func NewDiscoveryRESTMapper(groupResources []*APIGroupResources) meta.RESTMapper
NewDiscoveryRESTMapper returns a PriorityRESTMapper based on the discovered groups and resources passed in.
func NewShortcutExpander(delegate meta.RESTMapper, client discovery.DiscoveryInterface, warningHandler func(string)) meta.RESTMapper
NewShortcutExpander wraps a restmapper in a layer that expands shortcuts found via discovery
APIGroupResources is an API group with a mapping of versions to resources.
type APIGroupResources struct { Group metav1.APIGroup // A mapping of version string to a slice of APIResources for // that version. VersionedResources map[string][]metav1.APIResource }
func GetAPIGroupResources(cl discovery.DiscoveryInterface) ([]*APIGroupResources, error)
GetAPIGroupResources uses the provided discovery client to gather discovery information and populate a slice of APIGroupResources.
CategoryExpander maps category strings to GroupResources. Categories are classification or 'tag' of a group of resources.
type CategoryExpander interface { Expand(category string) ([]schema.GroupResource, bool) }
func NewDiscoveryCategoryExpander(client discovery.DiscoveryInterface) CategoryExpander
NewDiscoveryCategoryExpander returns a category expander that makes use of the "categories" fields from the API, found through the discovery client. In case of any error or no category found (which likely means we're at a cluster prior to categories support, fallback to the expander provided.
DeferredDiscoveryRESTMapper is a RESTMapper that will defer initialization of the RESTMapper until the first mapping is requested.
type DeferredDiscoveryRESTMapper struct {
// contains filtered or unexported fields
}
func NewDeferredDiscoveryRESTMapper(cl discovery.CachedDiscoveryInterface) *DeferredDiscoveryRESTMapper
NewDeferredDiscoveryRESTMapper returns a DeferredDiscoveryRESTMapper that will lazily query the provided client for discovery information to do REST mappings.
func (d *DeferredDiscoveryRESTMapper) KindFor(resource schema.GroupVersionResource) (gvk schema.GroupVersionKind, err error)
KindFor takes a partial resource and returns back the single match. It returns an error if there are multiple matches.
func (d *DeferredDiscoveryRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvks []schema.GroupVersionKind, err error)
KindsFor takes a partial resource and returns back the list of potential kinds in priority order.
func (d *DeferredDiscoveryRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (m *meta.RESTMapping, err error)
RESTMapping identifies a preferred resource mapping for the provided group kind.
func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) (ms []*meta.RESTMapping, err error)
RESTMappings returns the RESTMappings for the provided group kind in a rough internal preferred order. If no kind is found, it will return a NoResourceMatchError.
func (d *DeferredDiscoveryRESTMapper) Reset()
Reset resets the internally cached Discovery information and will cause the next mapping request to re-discover.
func (d *DeferredDiscoveryRESTMapper) ResourceFor(input schema.GroupVersionResource) (gvr schema.GroupVersionResource, err error)
ResourceFor takes a partial resource and returns back the single match. It returns an error if there are multiple matches.
func (d *DeferredDiscoveryRESTMapper) ResourceSingularizer(resource string) (singular string, err error)
ResourceSingularizer converts a resource name from plural to singular (e.g., from pods to pod).
func (d *DeferredDiscoveryRESTMapper) ResourcesFor(input schema.GroupVersionResource) (gvrs []schema.GroupVersionResource, err error)
ResourcesFor takes a partial resource and returns back the list of potential resource in priority order.
func (d *DeferredDiscoveryRESTMapper) String() string
SimpleCategoryExpander implements CategoryExpander interface using a static mapping of categories to GroupResource mapping.
type SimpleCategoryExpander struct { Expansions map[string][]schema.GroupResource }
func (e SimpleCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)
Expand fulfills CategoryExpander
UnionCategoryExpander implements CategoryExpander interface. It maps given category string to union of expansions returned by all the CategoryExpanders in the list.
type UnionCategoryExpander []CategoryExpander
func (u UnionCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)
Expand fulfills CategoryExpander