mod jobqueue;
mod log;
mod webhook;
pub use jobqueue::JobQueueChannel;
pub use log::LogChannel;
pub use webhook::WebhookChannel;
use crate::escalation::trait_::EscalationTicket;
use async_trait::async_trait;
use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ChannelError {
#[error("channel unavailable: {0}")]
Unavailable(String),
#[error("internal: {0}")]
Internal(String),
#[error("invalid webhook URL: {0}")]
InvalidUrl(String),
}
#[async_trait]
pub trait ChannelAdapter: Send + Sync {
async fn deliver(&self, ticket: &EscalationTicket) -> Result<(), ChannelError>;
fn name(&self) -> &'static str;
}