Documentation ¶
Index ¶
- func ConnectCluster(ctx context.Context, cluster *clusterapis.Cluster, proxyPath string, ...) (http.Handler, error)
- func GetTLSConfigForCluster(ctx context.Context, cluster *clusterapis.Cluster, ...) (*tls.Config, error)
- func ImpersonateToken(clusterName string, secret *corev1.Secret) (string, error)
- func Location(cluster *clusterapis.Cluster, tlsConfig *tls.Config) (*url.URL, http.RoundTripper, error)
- func NewThrottledUpgradeAwareProxyHandler(location *url.URL, transport http.RoundTripper, ...) *proxy.UpgradeAwareHandler
- func ParseProxyHeaders(proxyHeaders map[string]string) http.Header
- func SkipGroup(group string) bool
- type SecretGetterFunc
- type UpgradeAwareHandler
- type UpgradeDialer
- type UpgradeDialerWithConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectCluster ¶
func ConnectCluster(ctx context.Context, cluster *clusterapis.Cluster, proxyPath string, secretGetter SecretGetterFunc, responder registryrest.Responder) (http.Handler, error)
ConnectCluster returns a handler for proxy cluster.
func GetTLSConfigForCluster ¶ added in v1.9.0
func GetTLSConfigForCluster(ctx context.Context, cluster *clusterapis.Cluster, secretGetter SecretGetterFunc) (*tls.Config, error)
GetTLSConfigForCluster returns a tls config for the cluster.
func ImpersonateToken ¶ added in v1.8.0
ImpersonateToken returns the impersonate token of the cluster.
func Location ¶
func Location(cluster *clusterapis.Cluster, tlsConfig *tls.Config) (*url.URL, http.RoundTripper, error)
Location returns a URL to which one can send traffic for the specified cluster.
func NewThrottledUpgradeAwareProxyHandler ¶
func NewThrottledUpgradeAwareProxyHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder registryrest.Responder) *proxy.UpgradeAwareHandler
NewThrottledUpgradeAwareProxyHandler creates a new proxy handler with a default flush interval. Responder is required for returning errors to the caller.
func ParseProxyHeaders ¶ added in v1.6.3
ParseProxyHeaders parses the proxy headers.
Types ¶
type SecretGetterFunc ¶ added in v1.8.0
SecretGetterFunc is a function to get secret.
type UpgradeAwareHandler ¶ added in v1.6.3
type UpgradeAwareHandler struct { proxyutil.UpgradeAwareHandler UpgradeDialer *UpgradeDialer }
UpgradeAwareHandler is an interface for dialing a backend for an upgrade request
func NewUpgradeAwareHandler ¶ added in v1.6.3
func NewUpgradeAwareHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder proxyutil.ErrorResponder) *UpgradeAwareHandler
NewUpgradeAwareHandler creates a new proxy handler with a default flush interval. Responder is required for returning errors to the caller.
func (*UpgradeAwareHandler) ServeHTTP ¶ added in v1.6.3
func (h *UpgradeAwareHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP handles the proxy request
type UpgradeDialer ¶ added in v1.6.3
type UpgradeDialer struct { // Dialer is the dialer used to connect. Used if non-nil. Dialer *net.Dialer // contains filtered or unexported fields }
UpgradeDialer knows how to upgrade an HTTP request to one that supports multiplexed streams. After Dial() is invoked, Conn will be usable.
func NewUpgradeDialerWithConfig ¶ added in v1.6.3
func NewUpgradeDialerWithConfig(cfg UpgradeDialerWithConfig) *UpgradeDialer
NewUpgradeDialerWithConfig creates a new UpgradeRoundTripper with the specified configuration.
func (*UpgradeDialer) Dial ¶ added in v1.6.3
Dial implements k8s.io/apimachinery/pkg/util/net.Dialer.
func (*UpgradeDialer) TLSClientConfig ¶ added in v1.6.3
func (u *UpgradeDialer) TLSClientConfig() *tls.Config
TLSClientConfig implements pkg/util/net.TLSClientConfigHolder for proper TLS checking during proxying with a roundtripper.
type UpgradeDialerWithConfig ¶ added in v1.6.3
type UpgradeDialerWithConfig struct { // TLS configuration used by the round tripper. TLS *tls.Config // Header holds the HTTP request headers for dialing. Optional. Header http.Header // Proxier is a proxy function invoked on each request. Optional. Proxier func(*http.Request) (*url.URL, error) // PingPeriod is a period for sending Pings on the connection. // Optional. PingPeriod time.Duration }
UpgradeDialerWithConfig is a set of options for an UpgradeDialer.