internal

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package internal itself provides functionality to bootstrap the healthcheck program.

Index

Constants

View Source
const (
	// EnvNameService defines the name of the environment variable that contains the type of the service this run checks.
	// It must be one of the defined ServiceType values.
	EnvNameService = "HEALTHCHECK_SERVICE"
	// EnvNameTarget defines the name of the environment variable that contains the target of this check. What that means
	// depends on the given ServiceType.
	EnvNameTarget = "HEALTHCHECK_TARGET"
	// EnvNamePing defines the name of the environment variable that contains the healthchecks.io check UUID that shall be
	// triggered if the check succeeds.
	EnvNamePing = "HEALTHCHECK_PING"
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context) error

Run fetches program configuration, determines which check healthcheck shall perform and runs it.

Types

type ServiceType

type ServiceType string

ServiceType defines what kind of service is tested by this run. See constants in this package for more explanation.

const (
	// ServiceSMTPv6 defines that a SMTP service listening on a IPv6 address shall be checked. It does this by
	// resolving the MX record for the domain specified the EnvNameTarget env, connecting to the first IPv6 result
	// and asking the server to switch over to TLS via STARTTLS. If this succeeds and the provided TLS certificate is
	// valid and trusted by the system healthcheck runs on, the test is considered successful.
	ServiceSMTPv6 ServiceType = "smtpv6"
	// ServiceSMTPv4 is the same as ServiceSMTPv6 but only accepts IPv4 addresses in the MX record.
	ServiceSMTPv4 ServiceType = "smtpv4"
	// ServiceMatrixv6 defines that a matrix service listening on a IPv6 address shall be checked. It does this by
	// resolving the SRV record for the domain specified the EnvNameTarget env, connecting to the first IPv6 result
	// via HTTPS and querying the synapse health endpoint. If the endpoint returns with HTTP code 200 the test is
	// considered successful.
	ServiceMatrixv6 ServiceType = "matrixv6"
	// ServiceMatrixv4 is the same as ServiceMatrixv6 but only accepts IPv6 addresses in the SRV record.
	ServiceMatrixv4 ServiceType = "matrixv4"
	// ServiceCeph defines that a ceph cluster shall be checked. It does this by spawning the command
	// `ceph status -f json` via the exec module and captures the output. If ceph reports "HEALTH_OK" as health status
	// the test is considered successful. This requires a working ceph setup. A broken setup is considered a check failure.
	ServiceCeph ServiceType = "ceph"
)

Directories

Path Synopsis
Package ceph allows to check the status of ceph clusters.
Package ceph allows to check the status of ceph clusters.
Package matrix allows to check the status synapse matrix server.
Package matrix allows to check the status synapse matrix server.
Package ping allows to pick checks of healthchecks.io
Package ping allows to pick checks of healthchecks.io
Package resolve allows to resolve DNS records via cloudflare DNS servers.
Package resolve allows to resolve DNS records via cloudflare DNS servers.
Package smtp allows to monitor SMTP servers.
Package smtp allows to monitor SMTP servers.

Jump to

Keyboard shortcuts

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