healthcheck

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHTTP

func CheckHTTP(ctx context.Context, name, targetURL string) sitevalidate.Result

CheckHTTP verifies that url returns a 2xx or 3xx response from the host running sitectl.

func ProjectEnv

func ProjectEnv(ctx *config.Context) map[string]string

ProjectEnv reads the project's .env file. Missing or unparsable files return an empty map so health checks can continue with stack defaults.

func PublicURLFromEnv

func PublicURLFromEnv(ctx *config.Context, defaultScheme, defaultDomain string) string

PublicURLFromEnv builds a public app URL from .env values in the context project directory. It understands DOMAIN, URI_SCHEME, HOST_INSECURE_PORT, HOST_SECURE_PORT, and the common TRAEFIK_TLS_ENABLED flag.

Types

type DockerChecker

type DockerChecker struct {
	Context *config.Context
	Client  *sitectldocker.DockerClient
}

DockerChecker runs health checks against the Docker Compose project attached to a sitectl context.

func NewDockerChecker

func NewDockerChecker(ctx *config.Context) (*DockerChecker, error)

NewDockerChecker creates a Docker-backed checker for the given context.

func (*DockerChecker) CheckComposeServices

func (c *DockerChecker) CheckComposeServices(ctx context.Context, services ...string) ([]sitevalidate.Result, error)

CheckComposeServices verifies compose service containers are present, running, and either healthy or without a Docker healthcheck.

func (*DockerChecker) CheckHTTPFromContainer

func (c *DockerChecker) CheckHTTPFromContainer(ctx context.Context, name, service, targetURL string) sitevalidate.Result

CheckHTTPFromContainer verifies that url is reachable from inside service.

func (*DockerChecker) CheckMariaDB

func (c *DockerChecker) CheckMariaDB(ctx context.Context, service string) sitevalidate.Result

CheckMariaDB verifies that a MariaDB/MySQL service is accepting local connections from inside its own container.

func (*DockerChecker) CheckSolrCore

func (c *DockerChecker) CheckSolrCore(ctx context.Context, service, core string) sitevalidate.Result

CheckSolrCore verifies that a Solr core is loaded from inside the Solr container.

func (*DockerChecker) Close

func (c *DockerChecker) Close() error

Close releases resources owned by the checker.

func (*DockerChecker) ServiceExists

func (c *DockerChecker) ServiceExists(ctx context.Context, service string) (bool, error)

ServiceExists reports whether the current compose project has at least one container for service.

Jump to

Keyboard shortcuts

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