router

package
v0.0.0-...-b8d72a6 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	CA() (*tls.Certificate, error)
	InternalIP() string
	ExternalIP() string
	IdleGet(target string) (bool, error)
	IdleSet(target string, idle bool) error
	Start() error
}

type BackendKubernetes

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

func NewBackendKubernetes

func NewBackendKubernetes(router BackendRouter) (*BackendKubernetes, error)

func (*BackendKubernetes) CA

func (b *BackendKubernetes) CA() (*tls.Certificate, error)

func (*BackendKubernetes) ExternalIP

func (b *BackendKubernetes) ExternalIP() string

func (*BackendKubernetes) IdleGet

func (b *BackendKubernetes) IdleGet(target string) (bool, error)

func (*BackendKubernetes) IdleSet

func (b *BackendKubernetes) IdleSet(target string, idle bool) error

func (*BackendKubernetes) IdleUpdate

func (b *BackendKubernetes) IdleUpdate(namespace, service string, idle bool) error

func (*BackendKubernetes) InternalIP

func (b *BackendKubernetes) InternalIP() string

func (*BackendKubernetes) Start

func (b *BackendKubernetes) Start() error

type BackendRouter

type BackendRouter interface {
	TargetAdd(host, target string, idles bool) error
	TargetRemove(host, target string) error
}

type CacheDynamo

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

func NewCacheDynamo

func NewCacheDynamo(table string) *CacheDynamo

func (*CacheDynamo) Delete

func (c *CacheDynamo) Delete(ctx context.Context, key string) error

func (*CacheDynamo) Get

func (c *CacheDynamo) Get(ctx context.Context, key string) ([]byte, error)

func (*CacheDynamo) Put

func (c *CacheDynamo) Put(ctx context.Context, key string, data []byte) error

type DNS

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

func NewDNS

func NewDNS(conn net.PacketConn, router DNSRouter, internal bool) (*DNS, error)

func (*DNS) ListenAndServe

func (d *DNS) ListenAndServe() error

func (*DNS) ServeDNS

func (d *DNS) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

func (*DNS) Shutdown

func (d *DNS) Shutdown(ctx context.Context) error

type DNSRouter

type DNSRouter interface {
	RouterIP(internal bool) string
	TargetList(host string) ([]string, error)
	Upstream() (string, error)
}

type DeploymentController

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

func NewDeploymentController

func NewDeploymentController(kc kubernetes.Interface, backend *BackendKubernetes) (*DeploymentController, error)

func (*DeploymentController) Add

func (c *DeploymentController) Add(obj interface{}) error

func (*DeploymentController) Client

func (*DeploymentController) Delete

func (c *DeploymentController) Delete(obj interface{}) error

func (*DeploymentController) ListOptions

func (c *DeploymentController) ListOptions(opts *am.ListOptions)

func (*DeploymentController) Run

func (c *DeploymentController) Run()

func (*DeploymentController) Start

func (c *DeploymentController) Start() error

func (*DeploymentController) Stop

func (c *DeploymentController) Stop() error

func (*DeploymentController) Update

func (c *DeploymentController) Update(prev, cur interface{}) error

type HTTP

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

func NewHTTP

func NewHTTP(ln net.Listener, router HTTPRouter) (*HTTP, error)

func (*HTTP) ListenAndServe

func (h *HTTP) ListenAndServe() error

func (*HTTP) Port

func (h *HTTP) Port() (string, error)

func (*HTTP) ServeHTTP

func (h *HTTP) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*HTTP) Shutdown

func (h *HTTP) Shutdown(ctx context.Context) error

type HTTPRouter

type HTTPRouter interface {
	RequestBegin(target string) error
	RequestEnd(target string) error
	Route(host string) (string, error)
}

type IngressController

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

func NewIngressController

func NewIngressController(kc kubernetes.Interface, router BackendRouter) (*IngressController, error)

func (*IngressController) Add

func (c *IngressController) Add(obj interface{}) error

func (*IngressController) Client

func (*IngressController) Delete

func (c *IngressController) Delete(obj interface{}) error

func (*IngressController) ListOptions

func (c *IngressController) ListOptions(opts *am.ListOptions)

func (*IngressController) Run

func (c *IngressController) Run()

func (*IngressController) Start

func (c *IngressController) Start() error

func (*IngressController) Stop

func (c *IngressController) Stop() error

func (*IngressController) Update

func (c *IngressController) Update(prev, cur interface{}) error

type Router

type Router struct {
	DNSExternal Server
	DNSInternal Server
	HTTP        Server
	HTTPS       Server
	// contains filtered or unexported fields
}

func New

func New() (*Router, error)

func (*Router) RequestBegin

func (r *Router) RequestBegin(target string) error

func (*Router) RequestEnd

func (r *Router) RequestEnd(target string) error

func (*Router) Route

func (r *Router) Route(host string) (string, error)

func (*Router) RouterIP

func (r *Router) RouterIP(internal bool) string

func (*Router) Serve

func (r *Router) Serve() error

func (*Router) Shutdown

func (r *Router) Shutdown(ctx context.Context) error

func (*Router) TargetAdd

func (r *Router) TargetAdd(host, target string, idles bool) error

func (*Router) TargetList

func (r *Router) TargetList(host string) ([]string, error)

func (*Router) TargetRemove

func (r *Router) TargetRemove(host, target string) error

func (*Router) Upstream

func (r *Router) Upstream() (string, error)

type Server

type Server interface {
	ListenAndServe() error
	Shutdown(ctx context.Context) error
}

type Storage

type Storage interface {
	RequestBegin(target string) error
	RequestEnd(target string) error
	Stale(cutoff time.Time) ([]string, error)
	TargetAdd(host, target string, idles bool) error
	TargetList(host string) ([]string, error)
	TargetRemove(host, target string) error
}

type StorageDynamo

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

func NewStorageDynamo

func NewStorageDynamo(hosts, targets string) *StorageDynamo

func (*StorageDynamo) IdleGet

func (s *StorageDynamo) IdleGet(target string) (bool, error)

func (*StorageDynamo) IdleSet

func (s *StorageDynamo) IdleSet(target string, idle bool) error

func (*StorageDynamo) RequestBegin

func (s *StorageDynamo) RequestBegin(target string) error

func (*StorageDynamo) RequestEnd

func (s *StorageDynamo) RequestEnd(target string) error

func (*StorageDynamo) Stale

func (s *StorageDynamo) Stale(cutoff time.Time) ([]string, error)

func (*StorageDynamo) TargetAdd

func (s *StorageDynamo) TargetAdd(host, target string, idles bool) error

func (*StorageDynamo) TargetList

func (s *StorageDynamo) TargetList(host string) ([]string, error)

func (*StorageDynamo) TargetRemove

func (s *StorageDynamo) TargetRemove(host, target string) error

type StorageMemory

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

func NewStorageMemory

func NewStorageMemory() *StorageMemory

func (*StorageMemory) IdleGet

func (s *StorageMemory) IdleGet(target string) (bool, error)

func (*StorageMemory) IdleSet

func (s *StorageMemory) IdleSet(target string, idle bool) error

func (*StorageMemory) RequestBegin

func (s *StorageMemory) RequestBegin(target string) error

func (*StorageMemory) RequestEnd

func (s *StorageMemory) RequestEnd(target string) error

func (*StorageMemory) Stale

func (s *StorageMemory) Stale(cutoff time.Time) ([]string, error)

func (*StorageMemory) TargetAdd

func (s *StorageMemory) TargetAdd(host, target string, idles bool) error

func (*StorageMemory) TargetList

func (s *StorageMemory) TargetList(host string) ([]string, error)

func (*StorageMemory) TargetRemove

func (s *StorageMemory) TargetRemove(host, target string) error

Jump to

Keyboard shortcuts

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