client

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 102

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCluster

func SetCluster(cfg *rest.Config, clusterPath logicalcluster.Path) *rest.Config

SetCluster modifies the config host path to include the cluster endpoint.

Note: it is the caller responsibility to make a copy of the rest config.

Types

type Cache

type Cache[R any] interface {
	ClusterOrDie(clusterPath logicalcluster.Path) R
	Cluster(clusterPath logicalcluster.Path) (R, error)
}

Cache is a client factory that caches previous results.

func NewCache

func NewCache[R any](cfg *rest.Config, client *http.Client, constructor *Constructor[R]) Cache[R]

NewCache creates a new client factory cache using the given constructor.

type Constructor

type Constructor[R any] struct {
	NewForConfigAndClient func(*rest.Config, *http.Client) (R, error)
}

Constructor is a wrapper around a constructor method for the client of type R.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL