Initial commit: LoFlum FTP/SFTP client

Tauri 2 + Rust + Svelte 5. SFTP via ssh2, FTP via suppaftp.
Transfer queue with async worker, SQLite site storage, keychain.
This commit is contained in:
loki5512344 2026-06-13 12:06:56 +02:00
parent 0f182ab76f
commit 79855585bd
60 changed files with 14532 additions and 18 deletions

View file

@ -0,0 +1,25 @@
// Абстракция над RemoteFs для хранения активных соединений
// TODO: HashMap<connection_id, Arc<dyn RemoteFs>>
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use crate::protocols::RemoteFs;
#[derive(Default)]
pub struct RemoteRegistry {
connections: Mutex<HashMap<String, Arc<dyn RemoteFs>>>,
}
impl RemoteRegistry {
pub fn insert(&self, id: String, fs: Arc<dyn RemoteFs>) {
self.connections.lock().unwrap().insert(id, fs);
}
pub fn get(&self, id: &str) -> Option<Arc<dyn RemoteFs>> {
self.connections.lock().unwrap().get(id).cloned()
}
pub fn remove(&self, id: &str) {
self.connections.lock().unwrap().remove(id);
}
}