testcontainers_gleam/emqx
EMQX container configuration.
Wraps Testcontainers.EmqxContainer to provide typed builders
for an EMQX container. Use new to create a default configuration,
customize with with_* functions, then build to get a Container.
Default image: emqx:5.6.0, MQTT port: 1883, timeout: 60s.
Example
import testcontainers_gleam
import testcontainers_gleam/emqx
let config = emqx.new()
let container = emqx.build(config)
let assert Ok(running) = testcontainers_gleam.start_container(container)
let port = emqx.mqtt_port(running)
Types
Configuration for an EMQX container.
pub type EmqxConfig
Values
pub fn build(config: EmqxConfig) -> container.Container
Build a Container from this EMQX configuration.
pub fn mqtt_port(container: container.Container) -> Int
Get the host-mapped MQTT port for the EMQX container.
pub fn new() -> EmqxConfig
Create a new EMQX container configuration with defaults.
Default image: emqx:5.6.0, MQTT port: 1883, timeout: 60s.
pub fn with_check_image(
config: EmqxConfig,
pattern: String,
) -> EmqxConfig
Set the regex pattern to validate the image name.
pub fn with_image(
config: EmqxConfig,
image: String,
) -> EmqxConfig
Override the Docker image.
pub fn with_reuse(config: EmqxConfig, reuse: Bool) -> EmqxConfig
Enable or disable container reuse across test runs.