Skip to main content

sova_notifications/
lib.rs

1//! Database notifications with named channels, ACL, optional WS / mail.
2//!
3//! ```ignore
4//! app.install(
5//!   Notifications::new()
6//!     .channel(Channel::new("orders").publish("notifications.orders.publish"))
7//!     .mount("/notifications")
8//!     .guard(Fortify::guard())
9//! );
10//! Notify::to(user_id).channel("orders").event("order.shipped").title("Shipped").send(&req).await?;
11//! ```
12
13mod channel;
14mod entity;
15mod events;
16mod http;
17mod list;
18mod migration;
19mod notify;
20mod plugin;
21
22#[cfg(feature = "auth")]
23mod audience;
24
25#[cfg(feature = "ws")]
26mod ws;
27
28#[cfg(feature = "templates")]
29mod templates;
30
31pub use channel::{Channel, Via};
32pub use events::NotificationSent;
33pub use list::{
34    list_notifications, mark_all_read, mark_read, unread_count, NotificationFilter, NotificationRow,
35};
36pub use migration::NotificationsMigrator;
37pub use notify::{NotificationService, NotificationUser, Notify, NotifyExt};
38pub use plugin::Notifications;
39
40#[cfg(feature = "testing")]
41pub mod testing;
42
43#[cfg(feature = "templates")]
44pub use templates::{preload_unread, UnreadCount};