kubernetes: github.com/VictorDenisov/kubernetes/pkg/client/typed/discovery Index | Files

package discovery

import "github.com/VictorDenisov/kubernetes/pkg/client/typed/discovery"

Index

Package Files

discovery_client.go restmapper.go unstructured.go

func IsGroupDiscoveryFailedError Uses

func IsGroupDiscoveryFailedError(err error) bool

IsGroupDiscoveryFailedError returns true if the provided error indicates the server was unable to discover a complete list of APIs for the client to use.

func NewRESTMapper Uses

func NewRESTMapper(groupResources []*APIGroupResources, versionInterfaces meta.VersionInterfacesFunc) meta.RESTMapper

NewRESTMapper returns a PriorityRESTMapper based on the discovered groups and resourced passed in.

type APIGroupResources Uses

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

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

func GetAPIGroupResources Uses

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

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

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 DiscoveryInterface, versionInterface meta.VersionInterfacesFunc) *DeferredDiscoveryRESTMapper

NewDeferredDiscoveryRESTMapper returns a DeferredDiscoveryRESTMapper that will lazily query the provided client for discovery information to do REST mappings.

func (*DeferredDiscoveryRESTMapper) AliasesForResource Uses

func (d *DeferredDiscoveryRESTMapper) AliasesForResource(resource string) ([]string, bool)

AliasesForResource returns whether a resource has an alias or not.

func (*DeferredDiscoveryRESTMapper) KindFor Uses

func (d *DeferredDiscoveryRESTMapper) KindFor(resource unversioned.GroupVersionResource) (unversioned.GroupVersionKind, 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 unversioned.GroupVersionResource) ([]unversioned.GroupVersionKind, 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 unversioned.GroupKind, versions ...string) (*meta.RESTMapping, error)

RESTMapping identifies a preferred resource mapping for the provided group kind.

func (*DeferredDiscoveryRESTMapper) RESTMappings Uses

func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk unversioned.GroupKind) ([]*meta.RESTMapping, 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 unversioned.GroupVersionResource) (unversioned.GroupVersionResource, 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 unversioned.GroupVersionResource) ([]unversioned.GroupVersionResource, 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 DiscoveryClient Uses

type DiscoveryClient struct {
    *restclient.RESTClient

    LegacyPrefix string
}

DiscoveryClient implements the functions that discover server-supported API groups, versions and resources.

func NewDiscoveryClient Uses

func NewDiscoveryClient(c *restclient.RESTClient) *DiscoveryClient

New creates a new DiscoveryClient for the given RESTClient.

func NewDiscoveryClientForConfig Uses

func NewDiscoveryClientForConfig(c *restclient.Config) (*DiscoveryClient, error)

NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. This client can be used to discover supported resources in the API server.

func NewDiscoveryClientForConfigOrDie Uses

func NewDiscoveryClientForConfigOrDie(c *restclient.Config) *DiscoveryClient

NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. If there is an error, it panics.

func (*DiscoveryClient) ServerGroups Uses

func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList, err error)

ServerGroups returns the supported groups, with information like supported versions and the preferred version.

func (*DiscoveryClient) ServerPreferredNamespacedResources Uses

func (d *DiscoveryClient) ServerPreferredNamespacedResources() ([]unversioned.GroupVersionResource, error)

ServerPreferredNamespacedResources returns the supported namespaced resources with the version preferred by the server.

func (*DiscoveryClient) ServerPreferredResources Uses

func (d *DiscoveryClient) ServerPreferredResources() ([]unversioned.GroupVersionResource, error)

ServerPreferredResources returns the supported resources with the version preferred by the server.

func (*DiscoveryClient) ServerResources Uses

func (d *DiscoveryClient) ServerResources() (map[string]*unversioned.APIResourceList, error)

ServerResources returns the supported resources for all groups and versions.

func (*DiscoveryClient) ServerResourcesForGroupVersion Uses

func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (resources *unversioned.APIResourceList, err error)

ServerResourcesForGroupVersion returns the supported resources for a group and version.

func (*DiscoveryClient) ServerVersion Uses

func (d *DiscoveryClient) ServerVersion() (*version.Info, error)

ServerVersion retrieves and parses the server's version (git version).

func (*DiscoveryClient) SwaggerSchema Uses

func (d *DiscoveryClient) SwaggerSchema(version unversioned.GroupVersion) (*swagger.ApiDeclaration, error)

SwaggerSchema retrieves and parses the swagger API schema the server supports.

type DiscoveryInterface Uses

type DiscoveryInterface interface {
    ServerGroupsInterface
    ServerResourcesInterface
    ServerVersionInterface
    SwaggerSchemaInterface
}

DiscoveryInterface holds the methods that discover server-supported API groups, versions and resources.

type ErrGroupDiscoveryFailed Uses

type ErrGroupDiscoveryFailed struct {
    // Groups is a list of the groups that failed to load and the error cause
    Groups map[unversioned.GroupVersion]error
}

ErrGroupDiscoveryFailed is returned if one or more API groups fail to load.

func (*ErrGroupDiscoveryFailed) Error Uses

func (e *ErrGroupDiscoveryFailed) Error() string

Error implements the error interface

type ServerGroupsInterface Uses

type ServerGroupsInterface interface {
    // ServerGroups returns the supported groups, with information like supported versions and the
    // preferred version.
    ServerGroups() (*unversioned.APIGroupList, error)
}

ServerGroupsInterface has methods for obtaining supported groups on the API server

type ServerResourcesInterface Uses

type ServerResourcesInterface interface {
    // ServerResourcesForGroupVersion returns the supported resources for a group and version.
    ServerResourcesForGroupVersion(groupVersion string) (*unversioned.APIResourceList, error)
    // ServerResources returns the supported resources for all groups and versions.
    ServerResources() (map[string]*unversioned.APIResourceList, error)
    // ServerPreferredResources returns the supported resources with the version preferred by the
    // server.
    ServerPreferredResources() ([]unversioned.GroupVersionResource, error)
    // ServerPreferredNamespacedResources returns the supported namespaced resources with the
    // version preferred by the server.
    ServerPreferredNamespacedResources() ([]unversioned.GroupVersionResource, error)
}

ServerResourcesInterface has methods for obtaining supported resources on the API server

type ServerVersionInterface Uses

type ServerVersionInterface interface {
    // ServerVersion retrieves and parses the server's version (git version).
    ServerVersion() (*version.Info, error)
}

ServerVersionInterface has a method for retrieving the server's version.

type SwaggerSchemaInterface Uses

type SwaggerSchemaInterface interface {
    // SwaggerSchema retrieves and parses the swagger API schema the server supports.
    SwaggerSchema(version unversioned.GroupVersion) (*swagger.ApiDeclaration, error)
}

SwaggerSchemaInterface has a method to retrieve the swagger schema.

type UnstructuredObjectTyper Uses

type UnstructuredObjectTyper struct {
    // contains filtered or unexported fields
}

UnstructuredObjectTyper provides a runtime.ObjectTyper implmentation for runtime.Unstructured object based on discovery information.

func NewUnstructuredObjectTyper Uses

func NewUnstructuredObjectTyper(groupResources []*APIGroupResources) *UnstructuredObjectTyper

NewUnstructuredObjectTyper returns a runtime.ObjectTyper for unstructred objects based on discovery information.

func (*UnstructuredObjectTyper) IsUnversioned Uses

func (d *UnstructuredObjectTyper) IsUnversioned(obj runtime.Object) (unversioned bool, ok bool)

IsUnversioned returns false always because *runtime.Unstructured objects should always have group,version,kind information set. ok will be true if the object's group,version,kind is registered.

func (*UnstructuredObjectTyper) ObjectKind Uses

func (d *UnstructuredObjectTyper) ObjectKind(obj runtime.Object) (unversioned.GroupVersionKind, error)

ObjectKind returns the group,version,kind of the provided object, or an error if the object in not *runtime.Unstructured or has no group,version,kind information.

func (*UnstructuredObjectTyper) ObjectKinds Uses

func (d *UnstructuredObjectTyper) ObjectKinds(obj runtime.Object) (gvks []unversioned.GroupVersionKind, unversionedType bool, err error)

ObjectKinds returns a slice of one element with the group,version,kind of the provided object, or an error if the object is not *runtime.Unstructured or has no group,version,kind information. unversionedType will always be false because runtime.Unstructured object should always have group,version,kind information set.

func (*UnstructuredObjectTyper) Recognizes Uses

func (d *UnstructuredObjectTyper) Recognizes(gvk unversioned.GroupVersionKind) bool

Recognizes returns true if the provided group,version,kind was in the discovery information.

Package discovery imports 16 packages (graph). Updated 2019-09-19. Refresh now. Tools for package owners.