testcontainer_compose
Types
pub opaque type ComposeConfig
pub opaque type ComposeServices
Values
pub fn formula(
cfg: ComposeConfig,
) -> Result(
formula.StandaloneFormula(ComposeServices, error.Error),
error.Error,
)
pub fn from_file(file_path: String) -> ComposeConfig
pub fn parse_services_json(
path: String,
json_str: String,
) -> Result(List(Service), error.Error)
Parse a docker compose config --format json output string into typed
Service records. Exposed for testability — useful when you have a
pre-rendered compose JSON and want to validate parsing without Docker.
path is only used to enrich error messages.
pub fn service_by_name(
stack: ComposeServices,
name: String,
) -> option.Option(Service)
pub fn service_image(svc: Service) -> String
pub fn service_name(svc: Service) -> String
pub fn service_ports(svc: Service) -> List(#(Int, Int))
pub fn services(stack: ComposeServices) -> List(Service)
pub fn with_compose(
cfg: ComposeConfig,
body: fn(ComposeServices) -> Result(a, error.Error),
) -> Result(a, error.Error)
Spin up a compose stack, run the body, and always tear it down.
pub fn with_env_override(
cfg: ComposeConfig,
key: String,
value: String,
) -> ComposeConfig
pub fn with_project_name(
cfg: ComposeConfig,
project_name: String,
) -> ComposeConfig