testcontainer/network
Types
Values
pub fn create(name: String) -> Result(Network, error.Error)
Creates a new bridge network with the given name.
pub fn remove(network: Network) -> Result(Nil, error.Error)
Removes a network created via create/1.
pub fn with_network(
name: String,
body: fn(Network) -> Result(a, error.Error),
) -> Result(a, error.Error)
Creates a network, runs body/1, then removes it. Cleanup runs even if
body/1 returns an error or the caller process crashes (a linked guard
process performs the removal asynchronously on caller down).
use net <- network.with_network(“test-net”)