1use crate::structure::{GraphNodeUid, OpenPgpKey, OpenPgpUid};
2use std::collections::HashMap;
3use std::sync::{Arc, OnceLock};
4
5pub mod cert;
6pub mod github;
7pub mod gossip;
8pub mod helper;
9pub mod input;
10pub mod keyserver;
11pub mod structure;
12
13pub fn get_pgp_uid_by_node_uid<'a>(
14 key_set_map: &'a OnceLock<HashMap<Arc<std::string::String>, OpenPgpKey>>,
15 uid: &'a GraphNodeUid,
16) -> Option<&'a OpenPgpUid> {
17 key_set_map
18 .get()
19 .and_then(|v| {
20 v.get(&uid.fingerprint.to_string())
21 .map(|v| v.user_ids.get(&<&str as Into<String>>::into(uid.uid)))
22 })
23 .flatten()
24}