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§
- Duration
Spec - A Docker duration string such as
30s,1m, or500ms. - Healthcheck
Config - Docker healthcheck options and command.
Enums§
- Healthcheck
Command - A Docker healthcheck command.
- Healthcheck
Error - Error returned when healthcheck text is invalid.