Registry crate implementation

This commit is contained in:
mdecimus
2026-01-23 18:44:11 +01:00
parent 2266634f36
commit acecd32c8e
43 changed files with 2258 additions and 912 deletions

View File

@@ -10,6 +10,7 @@ nlp = { path = "../nlp" }
store = { path = "../store" }
trc = { path = "../trc" }
directory = { path = "../directory" }
coordinator = { path = "../coordinator" }
types = { path = "../types" }
jmap_proto = { path = "../jmap-proto" }
imap_proto = { path = "../imap-proto" }

View File

@@ -13,6 +13,7 @@ use crate::{
listener::tls::AcmeProviders, manager::config::ConfigManager,
};
use arc_swap::ArcSwap;
use coordinator::Coordinator;
use directory::{Directories, Directory};
use groupware::GroupwareConfig;
use hyper::HeaderMap;
@@ -132,21 +133,21 @@ impl Core {
}
})
.unwrap_or_default();
let pubsub = config
.value("cluster.coordinator")
.map(|id| id.to_string())
.and_then(|id| {
if let Some(store) = stores.pubsub_stores.get(&id) {
store.clone().into()
} else {
config.new_parse_error(
"cluster.coordinator",
format!("Coordinator backend {id:?} not found"),
);
None
}
})
.unwrap_or_default();
let pubsub = Coordinator::None; /*config
.value("cluster.coordinator")
.map(|id| id.to_string())
.and_then(|id| {
if let Some(store) = stores.pubsub_stores.get(&id) {
store.clone().into()
} else {
config.new_parse_error(
"cluster.coordinator",
format!("Coordinator backend {id:?} not found"),
);
None
}
})
.unwrap_or_default();*/
let mut directories =
Directories::parse(config, &stores, data.clone(), is_enterprise).await;
let directory = config

View File

@@ -4,11 +4,11 @@
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
*/
use std::sync::Arc;
use ahash::AHashMap;
use coordinator::Coordinator;
use directory::Directory;
use store::{BlobStore, SearchStore, InMemoryStore, PubSubStore, PurgeSchedule, Store};
use std::sync::Arc;
use store::{BlobStore, InMemoryStore, PurgeSchedule, SearchStore, Store};
use crate::manager::config::ConfigManager;
@@ -18,7 +18,7 @@ pub struct Storage {
pub blob: BlobStore,
pub fts: SearchStore,
pub lookup: InMemoryStore,
pub pubsub: PubSubStore,
pub pubsub: Coordinator,
pub directory: Arc<Directory>,
pub directories: AHashMap<String, Arc<Directory>>,
pub purge_schedules: Vec<PurgeSchedule>,

View File

@@ -76,7 +76,6 @@ impl Server {
blob_stores: self.core.storage.blobs.clone(),
search_stores: self.core.storage.ftss.clone(),
in_memory_stores: self.core.storage.lookups.clone(),
pubsub_stores: Default::default(),
purge_schedules: Default::default(),
};
stores.parse_stores(&mut config).await;