kubernetes: k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/cached/disk Index | Files

package disk

import "k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/cached/disk"


Package Files

cached_discovery.go round_tripper.go

type CachedDiscoveryClient Uses

type CachedDiscoveryClient struct {
    // contains filtered or unexported fields

CachedDiscoveryClient implements the functions that discovery server-supported API groups, versions and resources.

func NewCachedDiscoveryClientForConfig Uses

func NewCachedDiscoveryClientForConfig(config *restclient.Config, discoveryCacheDir, httpCacheDir string, ttl time.Duration) (*CachedDiscoveryClient, error)

NewCachedDiscoveryClientForConfig creates a new DiscoveryClient for the given config, and wraps the created client in a CachedDiscoveryClient. The provided configuration is updated with a custom transport that understands cache responses. We receive two distinct cache directories for now, in order to preserve old behavior which makes use of the --cache-dir flag value for storing cache data from the CacheRoundTripper, and makes use of the hardcoded destination (~/.kube/cache/discovery/...) for storing CachedDiscoveryClient cache data. If httpCacheDir is empty, the restconfig's transport will not be updated with a roundtripper that understands cache responses. If discoveryCacheDir is empty, cached server resource data will be looked up in the current directory.

func (*CachedDiscoveryClient) Fresh Uses

func (d *CachedDiscoveryClient) Fresh() bool

Fresh is supposed to tell the caller whether or not to retry if the cache fails to find something (false = retry, true = no need to retry).

func (*CachedDiscoveryClient) Invalidate Uses

func (d *CachedDiscoveryClient) Invalidate()

Invalidate enforces that no cached data is used in the future that is older than the current time.

func (*CachedDiscoveryClient) OpenAPISchema Uses

func (d *CachedDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error)

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

func (*CachedDiscoveryClient) RESTClient Uses

func (d *CachedDiscoveryClient) RESTClient() restclient.Interface

RESTClient returns a RESTClient that is used to communicate with API server by this client implementation.

func (*CachedDiscoveryClient) ServerGroups Uses

func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error)

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

func (*CachedDiscoveryClient) ServerGroupsAndResources Uses

func (d *CachedDiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)

ServerGroupsAndResources returns the supported groups and resources for all groups and versions.

func (*CachedDiscoveryClient) ServerPreferredNamespacedResources Uses

func (d *CachedDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)

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

func (*CachedDiscoveryClient) ServerPreferredResources Uses

func (d *CachedDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error)

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

func (*CachedDiscoveryClient) ServerResources Uses

func (d *CachedDiscoveryClient) ServerResources() ([]*metav1.APIResourceList, error)

ServerResources returns the supported resources for all groups and versions. Deprecated: use ServerGroupsAndResources instead.

func (*CachedDiscoveryClient) ServerResourcesForGroupVersion Uses

func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)

ServerResourcesForGroupVersion returns the supported resources for a group and version.

func (*CachedDiscoveryClient) ServerVersion Uses

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

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

Package disk imports 18 packages (graph). Updated 2020-08-01. Refresh now. Tools for package owners.