kubernetes: k8s.io/kubernetes/staging/src/k8s.io/client-go/restmapper Index | Files

package restmapper

import "k8s.io/kubernetes/staging/src/k8s.io/client-go/restmapper"


Package Files

category_expansion.go discovery.go shortcut.go

func NewDiscoveryRESTMapper Uses

func NewDiscoveryRESTMapper(groupResources []*APIGroupResources) meta.RESTMapper

NewDiscoveryRESTMapper returns a PriorityRESTMapper based on the discovered groups and resources passed in.

func NewShortcutExpander Uses

func NewShortcutExpander(delegate meta.RESTMapper, client discovery.DiscoveryInterface) meta.RESTMapper

NewShortcutExpander wraps a restmapper in a layer that expands shortcuts found via discovery

type APIGroupResources Uses

type APIGroupResources struct {
    Group metav1.APIGroup
    // A mapping of version string to a slice of APIResources for
    // that version.
    VersionedResources map[string][]metav1.APIResource

APIGroupResources is an API group with a mapping of versions to resources.

func GetAPIGroupResources Uses

func GetAPIGroupResources(cl discovery.DiscoveryInterface) ([]*APIGroupResources, error)

GetAPIGroupResources uses the provided discovery client to gather discovery information and populate a slice of APIGroupResources.

type CategoryExpander Uses

type CategoryExpander interface {
    Expand(category string) ([]schema.GroupResource, bool)

CategoryExpander maps category strings to GroupResources. Categories are classification or 'tag' of a group of resources.

func NewDiscoveryCategoryExpander Uses

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.

type DeferredDiscoveryRESTMapper Uses

type DeferredDiscoveryRESTMapper struct {
    // contains filtered or unexported fields

DeferredDiscoveryRESTMapper is a RESTMapper that will defer initialization of the RESTMapper until the first mapping is requested.

func NewDeferredDiscoveryRESTMapper Uses

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 (*DeferredDiscoveryRESTMapper) KindFor Uses

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 (*DeferredDiscoveryRESTMapper) KindsFor Uses

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 (*DeferredDiscoveryRESTMapper) RESTMapping Uses

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 (*DeferredDiscoveryRESTMapper) RESTMappings Uses

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 (*DeferredDiscoveryRESTMapper) Reset Uses

func (d *DeferredDiscoveryRESTMapper) Reset()

Reset resets the internally cached Discovery information and will cause the next mapping request to re-discover.

func (*DeferredDiscoveryRESTMapper) ResourceFor Uses

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 (*DeferredDiscoveryRESTMapper) ResourceSingularizer Uses

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 (*DeferredDiscoveryRESTMapper) ResourcesFor Uses

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 (*DeferredDiscoveryRESTMapper) String Uses

func (d *DeferredDiscoveryRESTMapper) String() string

type SimpleCategoryExpander Uses

type SimpleCategoryExpander struct {
    Expansions map[string][]schema.GroupResource

SimpleCategoryExpander implements CategoryExpander interface using a static mapping of categories to GroupResource mapping.

func (SimpleCategoryExpander) Expand Uses

func (e SimpleCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)

Expand fulfills CategoryExpander

type UnionCategoryExpander Uses

type UnionCategoryExpander []CategoryExpander

UnionCategoryExpander implements CategoryExpander interface. It maps given category string to union of expansions returned by all the CategoryExpanders in the list.

func (UnionCategoryExpander) Expand Uses

func (u UnionCategoryExpander) Expand(category string) ([]schema.GroupResource, bool)

Expand fulfills CategoryExpander

Package restmapper imports 8 packages (graph). Updated 2020-11-03. Refresh now. Tools for package owners.