{"modulePath":"github.com/UnityTech/client-go","version":"v11.0.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package restmapper\n\n## Functions\n\n```go\nfunc NewDiscoveryRESTMapper(groupResources []*APIGroupResources) meta.RESTMapper\n```\nNewDiscoveryRESTMapper returns a PriorityRESTMapper based on the discovered groups and resources passed in.\n\n```go\nfunc NewShortcutExpander(delegate meta.RESTMapper, client discovery.DiscoveryInterface) meta.RESTMapper\n```\nNewShortcutExpander wraps a restmapper in a layer that expands shortcuts found via discovery\n\n## Types\n\n```go\ntype APIGroupResources struct {\n\tGroup metav1.APIGroup\n\t// A mapping of version string to a slice of APIResources for\n\t// that version.\n\tVersionedResources map[string][]metav1.APIResource\n}\n```\nAPIGroupResources is an API group with a mapping of versions to resources.\n\n```go\nfunc GetAPIGroupResources(cl discovery.DiscoveryInterface) ([]*APIGroupResources, error)\n```\nGetAPIGroupResources uses the provided discovery client to gather discovery information and populate a slice of APIGroupResources.\n\n```go\ntype CategoryExpander interface {\n\tExpand(category string) ([]schema.GroupResource, bool)\n}\n```\nCategoryExpander maps category strings to GroupResources. Categories are classification or 'tag' of a group of resources.\n\n```go\nfunc NewDiscoveryCategoryExpander(client discovery.DiscoveryInterface) CategoryExpander\n```\nNewDiscoveryCategoryExpander 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.\n\n```go\ntype DeferredDiscoveryRESTMapper struct {\n\t// contains filtered or unexported fields\n}\n```\nDeferredDiscoveryRESTMapper is a RESTMapper that will defer initialization of the RESTMapper until the first mapping is requested.\n\n```go\nfunc NewDeferredDiscoveryRESTMapper(cl discovery.CachedDiscoveryInterface) *DeferredDiscoveryRESTMapper\n```\nNewDeferredDiscoveryRESTMapper returns a DeferredDiscoveryRESTMapper that will lazily query the provided client for discovery information to do REST mappings.\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) KindFor(resource schema.GroupVersionResource) (gvk schema.GroupVersionKind, err error)\n```\nKindFor takes a partial resource and returns back the single match. It returns an error if there are multiple matches.\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvks []schema.GroupVersionKind, err error)\n```\nKindsFor takes a partial resource and returns back the list of potential kinds in priority order.\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (m *meta.RESTMapping, err error)\n```\nRESTMapping identifies a preferred resource mapping for the provided group kind.\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) (ms []*meta.RESTMapping, err error)\n```\nRESTMappings returns the RESTMappings for the provided group kind in a rough internal preferred order. If no kind is found, it will return a NoResourceMatchError.\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) Reset()\n```\nReset resets the internally cached Discovery information and will cause the next mapping request to re-discover.\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) ResourceFor(input schema.GroupVersionResource) (gvr schema.GroupVersionResource, err error)\n```\nResourceFor takes a partial resource and returns back the single match. It returns an error if there are multiple matches.\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) ResourceSingularizer(resource string) (singular string, err error)\n```\nResourceSingularizer converts a resource name from plural to singular (e.g., from pods to pod).\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) ResourcesFor(input schema.GroupVersionResource) (gvrs []schema.GroupVersionResource, err error)\n```\nResourcesFor takes a partial resource and returns back the list of potential resource in priority order.\n\n```go\nfunc (d *DeferredDiscoveryRESTMapper) String() string\n```\n\n```go\ntype SimpleCategoryExpander struct {\n\tExpansions map[string][]schema.GroupResource\n}\n```\nSimpleCategoryExpander implements CategoryExpander interface using a static mapping of categories to GroupResource mapping.\n\n```go\nfunc (e SimpleCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)\n```\nExpand fulfills CategoryExpander\n\n```go\ntype UnionCategoryExpander []CategoryExpander\n```\nUnionCategoryExpander implements CategoryExpander interface. It maps given category string to union of expansions returned by all the CategoryExpanders in the list.\n\n```go\nfunc (u UnionCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)\n```\nExpand fulfills CategoryExpander\n\n","path":"github.com/UnityTech/client-go/restmapper","name":"restmapper","synopsis":"","isRedistributable":true}
