pub struct ContainerConfig {Show 14 fields
pub operation: String,
pub image: Option<String>,
pub name: Option<String>,
pub host: Option<String>,
pub cmd: Option<String>,
pub ports: Option<String>,
pub env: Option<String>,
pub network: Option<String>,
pub container_id: Option<String>,
pub follow: bool,
pub timestamps: bool,
pub tail: Option<String>,
pub auto_pull: bool,
pub auto_remove: bool,
}Expand description
Configuration for the container component endpoint.
This struct holds the parsed URI configuration including the operation type, optional container image, and Docker host connection details.
Fields§
§operation: StringThe operation to perform (e.g., “list”, “run”, “start”, “stop”, “remove”, “events”).
image: Option<String>The container image to use for “run” operations (can be overridden via header).
name: Option<String>The container name to use for “run” operations (can be overridden via header).
host: Option<String>The Docker host URL (defaults to “unix:///var/run/docker.sock”).
cmd: Option<String>Command to run in the container (e.g., “sleep 30”).
ports: Option<String>Port mappings in format “hostPort:containerPort” (e.g., “8080:80,8443:443”).
env: Option<String>Environment variables in format “KEY=value,KEY2=value2”.
network: Option<String>Network mode (e.g., “bridge”, “host”, “none”). Default: “bridge”.
container_id: Option<String>Container ID or name for logs consumer.
follow: boolFollow log output (default: true for consumer).
timestamps: boolInclude timestamps in logs (default: false).
tail: Option<String>Number of lines to show from the end of logs (default: all).
auto_pull: boolAutomatically pull the image if not present (default: true).
auto_remove: boolAutomatically remove the container when it exits (default: true).
Implementations§
Source§impl ContainerConfig
impl ContainerConfig
Sourcepub fn from_uri(uri: &str) -> Result<Self, CamelError>
pub fn from_uri(uri: &str) -> Result<Self, CamelError>
pub fn connect_docker_client(&self) -> Result<Docker, CamelError>
Sourcepub async fn connect_docker(&self) -> Result<Docker, CamelError>
pub async fn connect_docker(&self) -> Result<Docker, CamelError>
Connects to the Docker daemon using the configured host.
This method establishes a Unix socket connection to Docker and verifies the connection by sending a ping request.
§Errors
Returns an error if the connection fails or the ping request fails.
Trait Implementations§
Source§impl Clone for ContainerConfig
impl Clone for ContainerConfig
Source§fn clone(&self) -> ContainerConfig
fn clone(&self) -> ContainerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more