Skip to main content

Crate use_docker_healthcheck

Crate use_docker_healthcheck 

Source
Expand description

§use-docker-healthcheck

Primitive Docker healthcheck helpers for RustUse.

This crate models healthcheck commands and timing options. It renders Dockerfile-like fragments and never executes commands.

§Basic Usage

use use_docker_healthcheck::{DurationSpec, HealthcheckCommand, HealthcheckConfig};

let config = HealthcheckConfig::new(HealthcheckCommand::shell("curl -f http://localhost"))
    .with_interval(DurationSpec::new("30s")?)
    .with_retries(3);

assert_eq!(config.to_string(), "--interval=30s --retries=3 CMD-SHELL curl -f http://localhost");

Structs§

DurationSpec
A Docker duration string such as 30s, 1m, or 500ms.
HealthcheckConfig
Docker healthcheck options and command.

Enums§

HealthcheckCommand
A Docker healthcheck command.
HealthcheckError
Error returned when healthcheck text is invalid.