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§
- Bollard
Event Source - An event source that uses a
DockerClient(bollard) to stream Docker events. - Bollard
LogSource - A log source that uses a
DockerClient(bollard) to stream Docker container logs. - Mock
Event Source - Mock
LogSource
Enums§
Traits§
Functions§
- collect_
events - collect_
logs - Collect log lines into an
ExecutionResult(batch mode). - event_
row - log_row
- Convert a log message line into a
Rowwithline,message, andcontainerfields. - 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§
- Event
Stream - 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).