Removed filetransfer module; migrated to remotefs crate

This commit is contained in:
veeso
2021-12-09 18:07:36 +01:00
committed by Christian Visintin
parent 25dd1b9b0a
commit df7a4381c4
60 changed files with 1185 additions and 6814 deletions

View File

@@ -36,7 +36,7 @@ use std::str::FromStr;
///
/// UserHosts contains all the hosts saved by the user in the data storage
/// It contains both `Bookmark`
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize, Serialize, Debug, Default)]
pub struct UserHosts {
pub bookmarks: HashMap<String, Bookmark>,
pub recents: HashMap<String, Bookmark>,
@@ -76,15 +76,6 @@ pub struct S3Params {
// -- impls
impl Default for UserHosts {
fn default() -> Self {
Self {
bookmarks: HashMap::new(),
recents: HashMap::new(),
}
}
}
impl From<FileTransferParams> for Bookmark {
fn from(params: FileTransferParams) -> Self {
let protocol: FileTransferProtocol = params.protocol;

View File

@@ -35,7 +35,7 @@ use std::path::PathBuf;
pub const DEFAULT_NOTIFICATION_TRANSFER_THRESHOLD: u64 = 536870912; // 512MB
#[derive(Deserialize, Serialize, std::fmt::Debug)]
#[derive(Deserialize, Serialize, Debug, Default)]
/// ## UserConfig
///
/// UserConfig contains all the configurations for the user,
@@ -45,7 +45,7 @@ pub struct UserConfig {
pub remote: RemoteConfig,
}
#[derive(Deserialize, Serialize, std::fmt::Debug)]
#[derive(Deserialize, Serialize, Debug)]
/// ## UserInterfaceConfig
///
/// UserInterfaceConfig provides all the keys to configure the user interface
@@ -62,7 +62,7 @@ pub struct UserInterfaceConfig {
pub notification_threshold: Option<u64>, // @! Since 0.7.0; Default 512MB
}
#[derive(Deserialize, Serialize, std::fmt::Debug)]
#[derive(Deserialize, Serialize, Debug, Default)]
/// ## RemoteConfig
///
/// Contains configuratio related to remote hosts
@@ -70,15 +70,6 @@ pub struct RemoteConfig {
pub ssh_keys: HashMap<String, PathBuf>, // Association between host name and path to private key
}
impl Default for UserConfig {
fn default() -> Self {
UserConfig {
user_interface: UserInterfaceConfig::default(),
remote: RemoteConfig::default(),
}
}
}
impl Default for UserInterfaceConfig {
fn default() -> Self {
UserInterfaceConfig {
@@ -99,14 +90,6 @@ impl Default for UserInterfaceConfig {
}
}
impl Default for RemoteConfig {
fn default() -> Self {
RemoteConfig {
ssh_keys: HashMap::new(),
}
}
}
// Tests
#[cfg(test)]