Skip to main content

Module events

Module events 

Source
Expand description

Docker event streaming and collection.

Provides EventSource trait, BollardEventSource (live Docker events), and MockEventSource (testing). The stream_events function processes events through a DOL pipeline in real-time, while collect_events returns a batch result.

§Example

let source = BollardEventSource::new(Arc::new(docker));
events::stream_events(query, &source, |row| { println!("{row:?}"); Ok(()) }).await?;

Structs§

BollardEventSource
An event source that uses a DockerClient (bollard) to stream Docker events.
BollardLogSource
A log source that uses a DockerClient (bollard) to stream Docker container logs.
MockEventSource
MockLogSource

Enums§

EventsError

Traits§

EventSource
LogSource

Functions§

collect_events
collect_logs
Collect log lines into an ExecutionResult (batch mode).
event_row
log_row
Convert a log message line into a Row with line, message, and container fields.
parse_docker_event_json
stream_compose_logs
Stream compose service logs in real-time. Finds containers matching the compose project + service, merges their log streams via [futures_util::stream::select_all], and applies the compose query’s pipeline to each row.
stream_compose_networks
Stream Docker network events for a compose project in real-time. Streams Docker events, filters by event_type == "network" and the compose project label, and applies the compose query’s pipeline to each row.
stream_events
stream_logs
Stream log lines in real-time, applying the query pipeline to each row.

Type Aliases§

EventStream
Shared type alias for the complex event stream return type.
LogStream
Shared type alias for the log stream return type (mapped to EventsError).
RowStream
Shared type alias for the row-based stream return type (mapped to EventsError).