proxy

package
v0.0.0-...-c8dc4db Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSet

type ClientSet interface {
	Add(agent *v1alpha1.Agent) error

	Delete(name string) error
}

type HTTPProxy

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

func NewHTTPProxy

func NewHTTPProxy(ssh utils.GetSSHConn, kubernetesPort uint16, kubespherePort uint16, config *agent.Config, ca, serverCert, serverKey string) (*HTTPProxy, 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
	ServerCert string
	ServerKey  string
	// Port listening for agent connections.
	Host string
	Port uint16
	// Path to kubeconfig
	KubeconfigPath string

	// TODO: fill automatically
	ProxyServiceHost string
}

type Proxy

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

func NewServer

func NewServer(options *Options, client clientset.Interface) (*Proxy, error)

func (*Proxy) Add

func (s *Proxy) Add(agent *v1alpha1.Agent) error

func (*Proxy) Close

func (s *Proxy) Close() error

func (*Proxy) Delete

func (s *Proxy) Delete(name string) 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(agent *v1alpha1.Agent, 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