pub trait DockerServiceConfig: Send + 'static {
// Required methods
fn id(&self) -> String;
fn is_user_managed(&self) -> bool;
fn image(&self) -> String;
// Provided methods
fn args(&self) -> Vec<String> { ... }
fn envs(&self) -> Vec<(String, String)> { ... }
fn ports(&self) -> Vec<(String, String)> { ... }
fn data_path(&self) -> Option<String> { ... }
fn latency_ms(&self) -> u32 { ... }
}
Expand description
Configuration for a docker-backed service.
The trait can be implemented for the configuration struct of a service.
After that, use DockerService<Config>
as the service type.
Required Methods§
Sourcefn is_user_managed(&self) -> bool
fn is_user_managed(&self) -> bool
Whether the service is managed by the user.
If true, no docker container will be started and the service will be forwarded to
the DummyService
.
Provided Methods§
Sourcefn envs(&self) -> Vec<(String, String)>
fn envs(&self) -> Vec<(String, String)>
The environment variables to pass to the docker container.
Sourcefn ports(&self) -> Vec<(String, String)>
fn ports(&self) -> Vec<(String, String)>
The ports to expose on the host, e.g. ("0.0.0.0:23306", "3306")
.
The first element of the tuple is the host port (or address), the second is the container port.
Sourcefn data_path(&self) -> Option<String>
fn data_path(&self) -> Option<String>
The path in the container to persist data to, e.g. /var/lib/mysql
.
Some
if the service is specified to persist data, None
otherwise.
Sourcefn latency_ms(&self) -> u32
fn latency_ms(&self) -> u32
Network latency in milliseconds to add to the container.
Some
if latency should be added, None
otherwise.