1use axum_server::tls_rustls::RustlsConfig;
2use synd_persistence::sqlite::SqliteFeedRegistryDb;
3use synd_registry::FeedRegistry;
4
5use crate::{
6 monitor::Monitors,
7 serve::{ServeOptions, auth::Authenticator},
8 session::DaemonSessions,
9};
10
11pub type LiveFeedRegistry = FeedRegistry<SqliteFeedRegistryDb>;
12
13pub struct Dependency {
14 pub authenticator: Authenticator,
15 pub registry: LiveFeedRegistry,
16 pub tls_config: Option<RustlsConfig>,
17 pub serve_options: ServeOptions,
18 pub monitors: Monitors,
19 pub sessions: DaemonSessions,
20}
21
22impl Dependency {
23 pub fn new(
24 authenticator: Authenticator,
25 registry: LiveFeedRegistry,
26 tls_config: Option<RustlsConfig>,
27 serve_options: impl Into<ServeOptions>,
28 ) -> Self {
29 Self {
30 authenticator,
31 registry,
32 tls_config,
33 serve_options: serve_options.into(),
34 monitors: Monitors::new(),
35 sessions: DaemonSessions::default(),
36 }
37 }
38}