P0: config, DTOs, source traits, fakes, error, state and module stubs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa9b0da962
commit
1802f97d94
22 files changed
+1736
No files matched your search
@@ -0,0 +1,36 @@
|
||||
//! journald source over libsystemd (WS-B owns this file).
|
||||
//!
|
||||
//! STUB: signatures are final, bodies are `todo!()`.
|
||||
//! Notes for WS-B: `systemd::journal::Journal` is neither `Send` nor `Sync`.
|
||||
//! Open it inside `spawn_blocking` and never move it across threads or hold it
|
||||
//! across an `.await`. Namespaces need `OpenOptions::open_namespace`
|
||||
//! (feature `systemd_v245`, already enabled).
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tokio::sync::mpsc;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use super::{JournalEntry, JournalQuery, JournalSource};
|
||||
use crate::config::Config;
|
||||
use crate::error::AppError;
|
||||
|
||||
pub struct SdJournal {}
|
||||
|
||||
impl SdJournal {
|
||||
/// Must not fail or block. Reads `sources.journal_namespace` and
|
||||
/// `limits.max_lines` from `config`. Follow tasks stop on `shutdown`.
|
||||
pub fn new(_config: &Config, _shutdown: CancellationToken) -> Self {
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl JournalSource for SdJournal {
|
||||
async fn query(&self, _q: &JournalQuery) -> Result<Vec<JournalEntry>, AppError> {
|
||||
todo!("WS-B B2")
|
||||
}
|
||||
|
||||
async fn follow(&self, _q: &JournalQuery) -> Result<mpsc::Receiver<JournalEntry>, AppError> {
|
||||
todo!("WS-B B3")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user