proxy

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPProxy

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

func NewHTTPProxy

func NewHTTPProxy(sshConn ssh.Conn, kubernetesPort uint16, kubespherePort uint16, config *agent.Config, ca, serverCert, serverKey []byte) (*HTTPProxy, *http.Transport, *http.Transport, error)

func (*HTTPProxy) Start

func (proxy *HTTPProxy) Start(ctx context.Context) error

type HTTPServer

type HTTPServer struct {
	*http.Server
	// contains filtered or unexported fields
}

HTTPServer extends net/http Proxy and adds graceful shutdowns

func NewHTTPServer

func NewHTTPServer() *HTTPServer

func (*HTTPServer) Close

func (h *HTTPServer) Close() error

func (*HTTPServer) GoListenAndServe

func (h *HTTPServer) GoListenAndServe(addr string, handler http.Handler) error

func (*HTTPServer) Wait

func (h *HTTPServer) Wait() error

type Options

type Options struct {
	// Certificates to setup a proxy server.
	CaCert string
	CaKey  string
	// Port listening for agent connections.
	Host string
	Port int
	// Path to kubeconfig
	KubeConfigPath string

	// TODO: fill automatically
	PublishServiceAddress string
}

type Proxy

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

func NewServer

func NewServer(options *Options, clusterInformer clusterinformers.ClusterInformer, client clientset.Interface,
	k8sClientSet *kubernetes.Clientset) (*Proxy, error)

func (*Proxy) Close

func (s *Proxy) Close() error

func (*Proxy) Run

func (s *Proxy) Run(stopCh <-chan struct{}) error

func (*Proxy) Start

func (s *Proxy) Start(host, port string) error

func (*Proxy) Update

func (s *Proxy) Update(cluster *v1alpha1.Cluster, connected bool) error

func (*Proxy) Wait

func (s *Proxy) Wait() error

type Server

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

func (*Server) Error

func (s *Server) Error(_ http.ResponseWriter, req *http.Request, err error)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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