srvsighupreload

package
v0.0.0-...-62f2ae4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(
	filename string,
	dnsServer *srvdns.ServerPtr,
	httpServer *srvhttp.ServerPtr,
	certGetter *srvhttp.CertGetter,
	crStatesPoller *poller.Poller,
	crStatesIPoller *pollercrstates.IPoller,
	crConfigPoller *poller.Poller,
	crConfigIPoller *pollercrconfig.IPoller,
)

Listen starts listening for SIGHUP signals (typical of service reload commands), and reloads the config file when it receives one. The config file it reloads is the one received as a command-line argument on startup. The startup file given may not be changed without a restart. Likewise, the ports being served on require a restart to change. If there is an error loading the config file, the error is logged, and the existing server is left unchanged.

func TryReloadConfig

func TryReloadConfig(
	fileName string,
	dnsServer *srvdns.ServerPtr,
	httpServer *srvhttp.ServerPtr,
	certGetter *srvhttp.CertGetter,
	crStatesPoller *poller.Poller,
	crStatesIPoller *pollercrstates.IPoller,
	crConfigPoller *poller.Poller,
	crConfigIPoller *pollercrconfig.IPoller,

)

TryReloadConfig attemps to reload the given config file, and set the server pointers to its reloaded state. On error, logs but leaves the servers serving what they were before, does not crash or stop.

func UpdateCRConfigPoller

func UpdateCRConfigPoller(crConfigPoller *poller.Poller, crConfigIPoller *pollercrconfig.IPoller, cfg *config.Config, shared *shared.Shared)

func UpdateCRStatesPoller

func UpdateCRStatesPoller(crStatesPoller *poller.Poller, crStatesIPoller *pollercrstates.IPoller, cfg *config.Config, shared *shared.Shared)

func UpdateCerts

func UpdateCerts(certs map[string]*tls.Certificate, certGetter *srvhttp.CertGetter)

UpdateCerts updates certGetter with certs, deleting certs in the getter and not in certs, and adding to the getter new certificates in certs but not in certGetter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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