client

package
v0.0.0-...-f132488 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinURLPath

func JoinURLPath(a, b *url.URL) (path, rawpath string)

JoinURLPath function copied from httputil.reverseproxy.go

func NewClientCmd

func NewClientCmd() *cobra.Command

NewClientCmd create a gke client command

func RewriteRequestURL

func RewriteRequestURL(req *http.Request, target *url.URL)

RewriteRequestURL rewrites the `req` URL so that it can be forwarded to `target`

func SingleJoiningSlash

func SingleJoiningSlash(a, b string) string

SingleJoiningSlash function copied from httputil.reverseproxy.go

Types

type Proxy

type Proxy struct {
	cmd.RootCommand
	Audience              string
	ServiceAccount        string
	ConfigurationName     string
	UseDefaultCredentials bool
	TargetURL             string
	ProjectID             string
	ToGKEClusters         bool
	HostNames             []string
	HTTPProtocol          bool
	// contains filtered or unexported fields
}

Proxy for GKE private master endpoints

func (*Proxy) IsAllowedProxyEndpoint

func (p *Proxy) IsAllowedProxyEndpoint() goproxy.ReqConditionFunc

IsAllowedProxyEndpoint return true if the request is targets an allowed proxy endpoint

func (*Proxy) OnRequest

func (p *Proxy) OnRequest(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response)

OnRequest inserts the IAP required token and renames an existing Authorization header

func (*Proxy) Run

func (p *Proxy) Run() error

Run the proxy until stopped

Jump to

Keyboard shortcuts

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