daemon

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBufferSize = 20000

DefaultBufferSize the default siez for the buffer containing healthchecks results

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	Config      *Configuration
	MemoryStore *memorystore.MemoryStore
	Logger      *zap.Logger
	HTTP        *http.Component
	Healthcheck *healthcheck.Component
	Exporter    *exporter.Component
	Prometheus  *prometheus.Prometheus
	Discovery   *discovery.Component

	ChanResult chan *healthcheck.Result
	// contains filtered or unexported fields
}

Component is the component which will manage the HTTP server and the program configuration

func New

func New(logger *zap.Logger, config *Configuration) (*Component, error)

New creates and start a new daemon component

func (*Component) Reload

func (c *Component) Reload(daemonConfig *Configuration) error

Reload reloads the Cabourotte daemon. This function will remove or keep existing healthchecks depending of the new configuration. New checks will be added. The HTTP server will also be reloaded if its configuration has changed.

func (*Component) ReloadHealthchecks

func (c *Component) ReloadHealthchecks(daemonConfig *Configuration) error

ReloadHealthchecks reloads the healthchecks from a configuration

func (*Component) Stop

func (c *Component) Stop() error

Stop stops the Cabourotte daemon

type Configuration

type Configuration struct {
	ResultBuffer       uint `yaml:"result-buffer"`
	HTTP               http.Configuration
	HealthchecksLabels []string                                      `yaml:"healthchecks-labels"`
	CommandChecks      []healthcheck.CommandHealthcheckConfiguration `yaml:"command-checks"`
	DNSChecks          []healthcheck.DNSHealthcheckConfiguration     `yaml:"dns-checks"`
	TCPChecks          []healthcheck.TCPHealthcheckConfiguration     `yaml:"tcp-checks"`
	HTTPChecks         []healthcheck.HTTPHealthcheckConfiguration    `yaml:"http-checks"`
	TLSChecks          []healthcheck.TLSHealthcheckConfiguration     `yaml:"tls-checks"`
	Exporters          exporter.Configuration
	Discovery          discovery.Configuration
}

Configuration the HTTP server configuration

func (*Configuration) UnmarshalYAML

func (configuration *Configuration) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML Parse a configuration from YAML.

Jump to

Keyboard shortcuts

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