Documentation
¶
Index ¶
- func CheckHTTP(ctx context.Context, name, targetURL string) sitevalidate.Result
- func ProjectEnv(ctx *config.Context) map[string]string
- func PublicURLFromEnv(ctx *config.Context, defaultScheme, defaultDomain string) string
- type DockerChecker
- func (c *DockerChecker) CheckComposeServices(ctx context.Context, services ...string) ([]sitevalidate.Result, error)
- func (c *DockerChecker) CheckHTTPFromContainer(ctx context.Context, name, service, targetURL string) sitevalidate.Result
- func (c *DockerChecker) CheckMariaDB(ctx context.Context, service string) sitevalidate.Result
- func (c *DockerChecker) CheckSolrCore(ctx context.Context, service, core string) sitevalidate.Result
- func (c *DockerChecker) Close() error
- func (c *DockerChecker) ServiceExists(ctx context.Context, service string) (bool, error)
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 ¶
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 ¶
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 ¶
ServiceExists reports whether the current compose project has at least one container for service.