core

package
v0.0.0-...-17edc22 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// YES when yes smimply isn't good enough
	YES = "yes"
)

Variables

View Source
var (
	// APIEnabled defines wether or not the API is enabled
	APIEnabled = true
	// APITokenSigningKey is key used to sign jtw tokens
	APITokenSigningKey = rndKey()
	// APITokenDuration is how long the jwt token is valid
	APITokenDuration = 1 * time.Hour
)

Functions

func Cleanup

func Cleanup()

Cleanup the service

func CreateListeners

func CreateListeners()

CreateListeners for the pools

func DumpNodes

func DumpNodes()

DumpNodes dumps the current state of all backend nodes

func FormattedDate

func FormattedDate(t time.Time) string

FormattedDate date to readable time

func Initialize

func Initialize(reload <-chan bool)

Initialize the service

func RemoveListeners

func RemoveListeners()

RemoveListeners for the pools

func UpdateDNSConfig

func UpdateDNSConfig()

UpdateDNSConfig adds new records, and removes obsolete records

func WebBackendDetails

func WebBackendDetails(w http.ResponseWriter, r *http.Request)

WebBackendDetails Provides a detail page for backends

func WebBackendStatus

func WebBackendStatus(w http.ResponseWriter, r *http.Request)

WebBackendStatus Provides a status page for Backend Status

func WebClusterStatus

func WebClusterStatus(w http.ResponseWriter, r *http.Request)

WebClusterStatus Provides a status page for Cluster status

func WebGLBStatus

func WebGLBStatus(w http.ResponseWriter, r *http.Request)

WebGLBStatus Provides a status page for GLB

func WebLocalDNSStatus

func WebLocalDNSStatus(w http.ResponseWriter, r *http.Request)

WebLocalDNSStatus Provides a status page for GLB

func WebProxyStatus

func WebProxyStatus(w http.ResponseWriter, r *http.Request)

WebProxyStatus Provides a status page for Proxy service

func WebRoot

func WebRoot(w http.ResponseWriter, r *http.Request)

WebRoot serves Webserver's root folder

func WebSecurityHeaders

func WebSecurityHeaders(next http.Handler) http.Handler

WebSecurityHeaders adds security headers to the web gui

Types

type APIRequest

type APIRequest struct {
	Action  string `json:"action"`
	Manager string `json:"manager"`
	Node    string `json:"node"`
	Data    string `json:"data"`
}

APIRequest is used to pass requests done to the cluster API to the client application

type Manager

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

Manager main

func NewManager

func NewManager() *Manager

NewManager creates a new manager

func (*Manager) BackendNodeDiscard

func (manager *Manager) BackendNodeDiscard(node string)

BackendNodeDiscard removes backend nodes of a backendpool based on node name

func (*Manager) BackendNodeUpdate

func (manager *Manager) BackendNodeUpdate(pool string, backend string, node *config.BackendNode)

BackendNodeUpdate updates the backend nodes of a single backendpool

func (*Manager) ClusterClient

func (manager *Manager) ClusterClient(cl *cluster.Manager)

ClusterClient is the interface between the program and the cluster

func (*Manager) DNSHandler

func (manager *Manager) DNSHandler()

DNSHandler handles the DNS

func (*Manager) GetAllProxyStats

func (manager *Manager) GetAllProxyStats() []*config.ProxyBackendStatisticsUpdate

GetAllProxyStats gets all proxy statistics and sends them to the proxy handler

func (*Manager) GetAllProxyStatsHandler

func (manager *Manager) GetAllProxyStatsHandler()

GetAllProxyStatsHandler periodicly gets all stats

func (*Manager) HealthHandler

func (manager *Manager) HealthHandler(healthCheck *healthcheck.Manager)

HealthHandler gets all healthcheck feedback, and sends updates to the core manager We get all health checks here

func (*Manager) InitializeCluster

func (manager *Manager) InitializeCluster()

InitializeCluster sets up the cluster, starts it, and starts the client

func (Manager) InitializeDNSUpdates

func (manager Manager) InitializeDNSUpdates()

InitializeDNSUpdates manages DNS records

func (*Manager) InitializeHealthChecks

func (manager *Manager) InitializeHealthChecks(h *healthcheck.Manager)

InitializeHealthChecks sets up the health checking

func (*Manager) InitializeProxies

func (manager *Manager) InitializeProxies()

InitializeProxies sets up new proxies, and modifies existing one for reloads

func (*Manager) InitializeWebserver

func (m *Manager) InitializeWebserver()

InitializeWebserver starts the webserver

func (*Manager) NewServer

func (m *Manager) NewServer(ip string, port int) (s *http.Server, l net.Listener, err error)

NewServer sets up a new webserver

func (*Manager) ProxyHandler

func (manager *Manager) ProxyHandler()

ProxyHandler is the interface between the cluster and the proxies, passing along updates

func (Manager) StartDNSServer

func (manager Manager) StartDNSServer()

StartDNSServer starts the dns server

Jump to

Keyboard shortcuts

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