client

package
v2.0.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 19 modules, 120 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func SetMultiClusterRoundTripper

func SetMultiClusterRoundTripper(cfg *rest.Config) *rest.Config

SetMultiClusterRoundTripper wraps an existing config's roundtripper with a custom cluster aware roundtripper.

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 ClusterRoundTripper

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

ClusterRoundTripper is a cluster aware wrapper around http.RoundTripper

func NewClusterRoundTripper

func NewClusterRoundTripper(delegate http.RoundTripper) *ClusterRoundTripper

NewClusterRoundTripper creates a new cluster aware round tripper

func (*ClusterRoundTripper) RoundTrip

func (c *ClusterRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

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