public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client
@ 2020-07-17 15:43 Mira Limbeck
  2020-07-17 15:43 ` [pve-devel] [PATCH proxmox-backup 2/2] backup-client: change imports to not use '*' Mira Limbeck
  2020-07-17 15:44 ` [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client Mira Limbeck
  0 siblings, 2 replies; 3+ messages in thread
From: Mira Limbeck @ 2020-07-17 15:43 UTC (permalink / raw)
  To: pve-devel

Change the src/client.rs to make the modules public instead of
publically using each member. This simplified the code and keeps the
behaviour almost the same. Instead of using
'use proxmox_backup::client::*' we now have to use the full path
(e.g. 'use proxmox_backup::client::http_client::<Symbol>') instead.
This makes it clear where each symbol can be found.

As the client module is used in some other files, we need to adapt them
as well.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
---
It would be possible to keep the 'pub use <module>::*' lines so a
proxmox_backup::client::* import still works.

In my opinion this makes it a lot easier to look up symbols as you know
where they can be found instead of having to grep for the definitions.

What is your opinion on this matter?

Note: The use statements were formatted with rustfmt.

 src/api2/pull.rs                           |  6 +++++-
 src/bin/proxmox-backup-client.rs           | 14 +++++++++++--
 src/bin/proxmox-backup-manager.rs          |  5 ++++-
 src/bin/proxmox-backup-proxy.rs            |  6 +++++-
 src/bin/proxmox_backup_client/benchmark.rs |  2 +-
 src/bin/proxmox_backup_client/catalog.rs   |  2 +-
 src/bin/proxmox_backup_client/mount.rs     |  2 +-
 src/bin/proxmox_backup_client/task.rs      |  2 +-
 src/client.rs                              | 24 ++++++++--------------
 src/client/backup_reader.rs                |  2 +-
 src/client/backup_writer.rs                |  2 +-
 src/client/pull.rs                         |  5 ++++-
 src/client/remote_chunk_reader.rs          |  2 +-
 src/client/task_log.rs                     |  2 +-
 14 files changed, 46 insertions(+), 30 deletions(-)

diff --git a/src/api2/pull.rs b/src/api2/pull.rs
index cf7de524..d8991919 100644
--- a/src/api2/pull.rs
+++ b/src/api2/pull.rs
@@ -8,7 +8,11 @@ use proxmox::api::{ApiMethod, Router, RpcEnvironment, Permission};
 
 use crate::server::{WorkerTask};
 use crate::backup::DataStore;
-use crate::client::{HttpClient, HttpClientOptions, BackupRepository, pull::pull_store};
+use crate::client::{
+    backup_repo::BackupRepository,
+    http_client::{HttpClient, HttpClientOptions},
+    pull::pull_store
+};
 use crate::api2::types::*;
 use crate::config::{
     remote,
diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs
index d0620c0d..147eeba6 100644
--- a/src/bin/proxmox-backup-client.rs
+++ b/src/bin/proxmox-backup-client.rs
@@ -26,7 +26,17 @@ use pxar::accessor::{MaybeReady, ReadAt, ReadAtOperation};
 use proxmox_backup::tools;
 use proxmox_backup::api2::types::*;
 use proxmox_backup::api2::version;
-use proxmox_backup::client::*;
+use proxmox_backup::client::{
+    backup_reader::BackupReader,
+    backup_repo::{BackupRepository, BACKUP_REPO_URL},
+    backup_specification::{
+        parse_backup_specification, BackupSpecificationType, BACKUP_SOURCE_SCHEMA,
+    },
+    backup_writer::{BackupStats, BackupWriter},
+    http_client::{delete_ticket_info, HttpClient, HttpClientOptions},
+    pxar_backup_stream::PxarBackupStream,
+    task_log::display_task_log,
+};
 use proxmox_backup::pxar::catalog::*;
 use proxmox_backup::backup::{
     archive_type,
@@ -1826,7 +1836,7 @@ fn complete_chunk_size(_arg: &str, _param: &HashMap<String, String>) -> Vec<Stri
     result
 }
 
-use proxmox_backup::client::RemoteChunkReader;
+use proxmox_backup::client::remote_chunk_reader::RemoteChunkReader;
 /// This is a workaround until we have cleaned up the chunk/reader/... infrastructure for better
 /// async use!
 ///
diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs
index 7ae0852f..4ef8d340 100644
--- a/src/bin/proxmox-backup-manager.rs
+++ b/src/bin/proxmox-backup-manager.rs
@@ -8,7 +8,10 @@ use proxmox::api::{api, cli::*, RpcEnvironment};
 use proxmox_backup::tools;
 use proxmox_backup::config;
 use proxmox_backup::api2::{self, types::* };
-use proxmox_backup::client::*;
+use proxmox_backup::client::{
+    http_client::{HttpClient, HttpClientOptions},
+    task_log::display_task_log,
+};
 use proxmox_backup::tools::ticket::*;
 use proxmox_backup::auth_helpers::*;
 
diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index 75f53b9b..9bb4c459 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -467,7 +467,11 @@ async fn schedule_datastore_sync_jobs() {
 
     use proxmox_backup::{
         backup::DataStore,
-        client::{ HttpClient, HttpClientOptions, BackupRepository, pull::pull_store },
+        client::{
+            backup_repo::BackupRepository,
+            http_client::{HttpClient, HttpClientOptions},
+            pull::pull_store
+        },
         server::{ WorkerTask },
         config::{ sync::{self, SyncJobConfig}, remote::{self, Remote} },
         tools::systemd::time::{ parse_calendar_event, compute_next_event },
diff --git a/src/bin/proxmox_backup_client/benchmark.rs b/src/bin/proxmox_backup_client/benchmark.rs
index 6392f282..1b42aff0 100644
--- a/src/bin/proxmox_backup_client/benchmark.rs
+++ b/src/bin/proxmox_backup_client/benchmark.rs
@@ -24,7 +24,7 @@ use proxmox_backup::backup::{
     KeyDerivationConfig,
 };
 
-use proxmox_backup::client::*;
+use proxmox_backup::client::{backup_repo::BackupRepository, backup_writer::BackupWriter};
 
 use crate::{
     KEYFILE_SCHEMA, REPO_URL_SCHEMA,
diff --git a/src/bin/proxmox_backup_client/catalog.rs b/src/bin/proxmox_backup_client/catalog.rs
index 1c0865e6..f9f88c87 100644
--- a/src/bin/proxmox_backup_client/catalog.rs
+++ b/src/bin/proxmox_backup_client/catalog.rs
@@ -9,7 +9,7 @@ use proxmox::api::{api, cli::*};
 
 use proxmox_backup::tools;
 
-use proxmox_backup::client::*;
+use proxmox_backup::client::{backup_reader::BackupReader, remote_chunk_reader::RemoteChunkReader};
 
 use crate::{
     REPO_URL_SCHEMA,
diff --git a/src/bin/proxmox_backup_client/mount.rs b/src/bin/proxmox_backup_client/mount.rs
index 73bb8d4c..40af1740 100644
--- a/src/bin/proxmox_backup_client/mount.rs
+++ b/src/bin/proxmox_backup_client/mount.rs
@@ -25,7 +25,7 @@ use proxmox_backup::backup::{
     BufferedDynamicReader,
 };
 
-use proxmox_backup::client::*;
+use proxmox_backup::client::{backup_reader::BackupReader, remote_chunk_reader::RemoteChunkReader};
 
 use crate::{
     REPO_URL_SCHEMA,
diff --git a/src/bin/proxmox_backup_client/task.rs b/src/bin/proxmox_backup_client/task.rs
index 96a28be9..55b58949 100644
--- a/src/bin/proxmox_backup_client/task.rs
+++ b/src/bin/proxmox_backup_client/task.rs
@@ -5,7 +5,7 @@ use proxmox::api::{api, cli::*};
 
 use proxmox_backup::tools;
 
-use proxmox_backup::client::*;
+use proxmox_backup::client::task_log::display_task_log;
 use proxmox_backup::api2::types::UPID_SCHEMA;
 
 use crate::{
diff --git a/src/client.rs b/src/client.rs
index 3fb01f8a..9f649685 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -6,28 +6,20 @@
 mod merge_known_chunks;
 pub mod pipe_to_stream;
 
-mod http_client;
-pub use http_client::*;
+pub mod http_client;
 
-mod task_log;
-pub use task_log::*;
+pub mod task_log;
 
-mod backup_reader;
-pub use backup_reader::*;
+pub mod backup_reader;
 
-mod backup_writer;
-pub use backup_writer::*;
+pub mod backup_writer;
 
-mod remote_chunk_reader;
-pub use remote_chunk_reader::*;
+pub mod remote_chunk_reader;
 
-mod pxar_backup_stream;
-pub use pxar_backup_stream::*;
+pub mod pxar_backup_stream;
 
-mod backup_repo;
-pub use backup_repo::*;
+pub mod backup_repo;
 
-mod backup_specification;
-pub use backup_specification::*;
+pub mod backup_specification;
 
 pub mod pull;
diff --git a/src/client/backup_reader.rs b/src/client/backup_reader.rs
index b0b43c38..9e058a0b 100644
--- a/src/client/backup_reader.rs
+++ b/src/client/backup_reader.rs
@@ -12,7 +12,7 @@ use proxmox::tools::digest_to_hex;
 
 use crate::backup::*;
 
-use super::{HttpClient, H2Client};
+use super::http_client::{HttpClient, H2Client};
 
 /// Backup Reader
 pub struct BackupReader {
diff --git a/src/client/backup_writer.rs b/src/client/backup_writer.rs
index 17c09d77..e073f627 100644
--- a/src/client/backup_writer.rs
+++ b/src/client/backup_writer.rs
@@ -17,7 +17,7 @@ use proxmox::tools::digest_to_hex;
 use super::merge_known_chunks::{MergedChunkInfo, MergeKnownChunks};
 use crate::backup::*;
 
-use super::{HttpClient, H2Client};
+use super::http_client::{HttpClient, H2Client};
 
 pub struct BackupWriter {
     h2: H2Client,
diff --git a/src/client/pull.rs b/src/client/pull.rs
index 5cf0dd1f..37e7b0c9 100644
--- a/src/client/pull.rs
+++ b/src/client/pull.rs
@@ -11,7 +11,10 @@ use chrono::{Utc, TimeZone};
 use crate::server::{WorkerTask};
 use crate::backup::*;
 use crate::api2::types::*;
-use super::*;
+use super::backup_reader::{compute_file_csum, BackupReader};
+use super::backup_repo::BackupRepository;
+use super::http_client::{HttpClient, HttpClientOptions};
+use super::remote_chunk_reader::RemoteChunkReader;
 
 
 // fixme: implement filters
diff --git a/src/client/remote_chunk_reader.rs b/src/client/remote_chunk_reader.rs
index eeb4851b..4e6583ee 100644
--- a/src/client/remote_chunk_reader.rs
+++ b/src/client/remote_chunk_reader.rs
@@ -5,7 +5,7 @@ use std::sync::{Arc, Mutex};
 
 use anyhow::Error;
 
-use super::BackupReader;
+use super::backup_reader::BackupReader;
 use crate::backup::{AsyncReadChunk, CryptConfig, DataBlob, ReadChunk};
 use crate::tools::runtime::block_on;
 
diff --git a/src/client/task_log.rs b/src/client/task_log.rs
index 4db2a8e0..9d01537e 100644
--- a/src/client/task_log.rs
+++ b/src/client/task_log.rs
@@ -1,7 +1,7 @@
 use anyhow::{bail, Error};
 use serde_json::json;
 
-use super::HttpClient;
+use super::http_client::HttpClient;
 
 pub async fn display_task_log(
     client: HttpClient,
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH proxmox-backup 2/2] backup-client: change imports to not use '*'
  2020-07-17 15:43 [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client Mira Limbeck
@ 2020-07-17 15:43 ` Mira Limbeck
  2020-07-17 15:44 ` [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client Mira Limbeck
  1 sibling, 0 replies; 3+ messages in thread
From: Mira Limbeck @ 2020-07-17 15:43 UTC (permalink / raw)
  To: pve-devel

Import the required symbols directly instead of importing everything
there is with '*'. This makes it clear which symbol is exported by which
crate and module.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
---
Only proxmox_backup::client and proxmox_backup_client have been changed
to import via the submodule namespace, not directly. As for the others,
those would probably require lots of changes as many files depend on
them. But because this is probably a controversial change, I'd rather
get the opinion of others before committing to changing them.

The previous and this patch are in preparation of separating the
proxmox-backup-client from the proxmox-backup crate.

 src/bin/proxmox-backup-client.rs     | 21 ++++++++++++++++-----
 src/bin/proxmox_backup_client/mod.rs | 12 ++++--------
 2 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs
index 147eeba6..53fc84fb 100644
--- a/src/bin/proxmox-backup-client.rs
+++ b/src/bin/proxmox-backup-client.rs
@@ -18,13 +18,21 @@ use xdg::BaseDirectories;
 use pathpatterns::{MatchEntry, MatchType, PatternFlag};
 use proxmox::tools::fs::{file_get_contents, file_get_json, replace_file, CreateOptions, image_size};
 use proxmox::api::{ApiHandler, ApiMethod, RpcEnvironment};
-use proxmox::api::schema::*;
-use proxmox::api::cli::*;
+use proxmox::api::schema::{BooleanSchema, IntegerSchema, ObjectSchema, Schema, StringSchema};
+use proxmox::api::cli::{
+    default_table_format_options, format_and_print_result, format_and_print_result_full,
+    get_output_format, run_cli_command, CliCommand, CliCommandMap, CliEnvironment, ColumnConfig,
+    OUTPUT_FORMAT,
+};
 use proxmox::api::api;
 use pxar::accessor::{MaybeReady, ReadAt, ReadAtOperation};
 
 use proxmox_backup::tools;
-use proxmox_backup::api2::types::*;
+use proxmox_backup::api2::types::{
+    GroupListItem, PruneListItem, SnapshotListItem, BACKUP_ID_SCHEMA, BACKUP_TIME_SCHEMA,
+    BACKUP_TYPE_SCHEMA, PRUNE_SCHEMA_KEEP_DAILY, PRUNE_SCHEMA_KEEP_HOURLY, PRUNE_SCHEMA_KEEP_LAST,
+    PRUNE_SCHEMA_KEEP_MONTHLY, PRUNE_SCHEMA_KEEP_WEEKLY, PRUNE_SCHEMA_KEEP_YEARLY,
+};
 use proxmox_backup::api2::version;
 use proxmox_backup::client::{
     backup_reader::BackupReader,
@@ -37,7 +45,7 @@ use proxmox_backup::client::{
     pxar_backup_stream::PxarBackupStream,
     task_log::display_task_log,
 };
-use proxmox_backup::pxar::catalog::*;
+use proxmox_backup::pxar::catalog::BackupCatalogWriter;
 use proxmox_backup::backup::{
     archive_type,
     decrypt_key,
@@ -64,7 +72,10 @@ use proxmox_backup::backup::{
 };
 
 mod proxmox_backup_client;
-use proxmox_backup_client::*;
+use proxmox_backup_client::{
+    benchmark::API_METHOD_BENCHMARK, catalog::catalog_mgmt_cli, key, mount::mount_cmd_def,
+    task::task_mgmt_cli,
+};
 
 const ENV_VAR_PBS_FINGERPRINT: &str = "PBS_FINGERPRINT";
 const ENV_VAR_PBS_PASSWORD: &str = "PBS_PASSWORD";
diff --git a/src/bin/proxmox_backup_client/mod.rs b/src/bin/proxmox_backup_client/mod.rs
index 0c4bffb9..b565a633 100644
--- a/src/bin/proxmox_backup_client/mod.rs
+++ b/src/bin/proxmox_backup_client/mod.rs
@@ -1,13 +1,9 @@
 use anyhow::{Context, Error};
 
-mod benchmark;
-pub use benchmark::*;
-mod mount;
-pub use mount::*;
-mod task;
-pub use task::*;
-mod catalog;
-pub use catalog::*;
+pub mod benchmark;
+pub mod mount;
+pub mod task;
+pub mod catalog;
 
 pub mod key;
 
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client
  2020-07-17 15:43 [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client Mira Limbeck
  2020-07-17 15:43 ` [pve-devel] [PATCH proxmox-backup 2/2] backup-client: change imports to not use '*' Mira Limbeck
@ 2020-07-17 15:44 ` Mira Limbeck
  1 sibling, 0 replies; 3+ messages in thread
From: Mira Limbeck @ 2020-07-17 15:44 UTC (permalink / raw)
  To: pve-devel

Sent it to the wrong mailing list by accident, please disregard.


On 7/17/20 5:43 PM, Mira Limbeck wrote:
> Change the src/client.rs to make the modules public instead of
> publically using each member. This simplified the code and keeps the
> behaviour almost the same. Instead of using
> 'use proxmox_backup::client::*' we now have to use the full path
> (e.g. 'use proxmox_backup::client::http_client::<Symbol>') instead.
> This makes it clear where each symbol can be found.
>
> As the client module is used in some other files, we need to adapt them
> as well.
>
> Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
> ---
> It would be possible to keep the 'pub use <module>::*' lines so a
> proxmox_backup::client::* import still works.
>
> In my opinion this makes it a lot easier to look up symbols as you know
> where they can be found instead of having to grep for the definitions.
>
> What is your opinion on this matter?
>
> Note: The use statements were formatted with rustfmt.
>
>   src/api2/pull.rs                           |  6 +++++-
>   src/bin/proxmox-backup-client.rs           | 14 +++++++++++--
>   src/bin/proxmox-backup-manager.rs          |  5 ++++-
>   src/bin/proxmox-backup-proxy.rs            |  6 +++++-
>   src/bin/proxmox_backup_client/benchmark.rs |  2 +-
>   src/bin/proxmox_backup_client/catalog.rs   |  2 +-
>   src/bin/proxmox_backup_client/mount.rs     |  2 +-
>   src/bin/proxmox_backup_client/task.rs      |  2 +-
>   src/client.rs                              | 24 ++++++++--------------
>   src/client/backup_reader.rs                |  2 +-
>   src/client/backup_writer.rs                |  2 +-
>   src/client/pull.rs                         |  5 ++++-
>   src/client/remote_chunk_reader.rs          |  2 +-
>   src/client/task_log.rs                     |  2 +-
>   14 files changed, 46 insertions(+), 30 deletions(-)
>
> diff --git a/src/api2/pull.rs b/src/api2/pull.rs
> index cf7de524..d8991919 100644
> --- a/src/api2/pull.rs
> +++ b/src/api2/pull.rs
> @@ -8,7 +8,11 @@ use proxmox::api::{ApiMethod, Router, RpcEnvironment, Permission};
>   
>   use crate::server::{WorkerTask};
>   use crate::backup::DataStore;
> -use crate::client::{HttpClient, HttpClientOptions, BackupRepository, pull::pull_store};
> +use crate::client::{
> +    backup_repo::BackupRepository,
> +    http_client::{HttpClient, HttpClientOptions},
> +    pull::pull_store
> +};
>   use crate::api2::types::*;
>   use crate::config::{
>       remote,
> diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs
> index d0620c0d..147eeba6 100644
> --- a/src/bin/proxmox-backup-client.rs
> +++ b/src/bin/proxmox-backup-client.rs
> @@ -26,7 +26,17 @@ use pxar::accessor::{MaybeReady, ReadAt, ReadAtOperation};
>   use proxmox_backup::tools;
>   use proxmox_backup::api2::types::*;
>   use proxmox_backup::api2::version;
> -use proxmox_backup::client::*;
> +use proxmox_backup::client::{
> +    backup_reader::BackupReader,
> +    backup_repo::{BackupRepository, BACKUP_REPO_URL},
> +    backup_specification::{
> +        parse_backup_specification, BackupSpecificationType, BACKUP_SOURCE_SCHEMA,
> +    },
> +    backup_writer::{BackupStats, BackupWriter},
> +    http_client::{delete_ticket_info, HttpClient, HttpClientOptions},
> +    pxar_backup_stream::PxarBackupStream,
> +    task_log::display_task_log,
> +};
>   use proxmox_backup::pxar::catalog::*;
>   use proxmox_backup::backup::{
>       archive_type,
> @@ -1826,7 +1836,7 @@ fn complete_chunk_size(_arg: &str, _param: &HashMap<String, String>) -> Vec<Stri
>       result
>   }
>   
> -use proxmox_backup::client::RemoteChunkReader;
> +use proxmox_backup::client::remote_chunk_reader::RemoteChunkReader;
>   /// This is a workaround until we have cleaned up the chunk/reader/... infrastructure for better
>   /// async use!
>   ///
> diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs
> index 7ae0852f..4ef8d340 100644
> --- a/src/bin/proxmox-backup-manager.rs
> +++ b/src/bin/proxmox-backup-manager.rs
> @@ -8,7 +8,10 @@ use proxmox::api::{api, cli::*, RpcEnvironment};
>   use proxmox_backup::tools;
>   use proxmox_backup::config;
>   use proxmox_backup::api2::{self, types::* };
> -use proxmox_backup::client::*;
> +use proxmox_backup::client::{
> +    http_client::{HttpClient, HttpClientOptions},
> +    task_log::display_task_log,
> +};
>   use proxmox_backup::tools::ticket::*;
>   use proxmox_backup::auth_helpers::*;
>   
> diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
> index 75f53b9b..9bb4c459 100644
> --- a/src/bin/proxmox-backup-proxy.rs
> +++ b/src/bin/proxmox-backup-proxy.rs
> @@ -467,7 +467,11 @@ async fn schedule_datastore_sync_jobs() {
>   
>       use proxmox_backup::{
>           backup::DataStore,
> -        client::{ HttpClient, HttpClientOptions, BackupRepository, pull::pull_store },
> +        client::{
> +            backup_repo::BackupRepository,
> +            http_client::{HttpClient, HttpClientOptions},
> +            pull::pull_store
> +        },
>           server::{ WorkerTask },
>           config::{ sync::{self, SyncJobConfig}, remote::{self, Remote} },
>           tools::systemd::time::{ parse_calendar_event, compute_next_event },
> diff --git a/src/bin/proxmox_backup_client/benchmark.rs b/src/bin/proxmox_backup_client/benchmark.rs
> index 6392f282..1b42aff0 100644
> --- a/src/bin/proxmox_backup_client/benchmark.rs
> +++ b/src/bin/proxmox_backup_client/benchmark.rs
> @@ -24,7 +24,7 @@ use proxmox_backup::backup::{
>       KeyDerivationConfig,
>   };
>   
> -use proxmox_backup::client::*;
> +use proxmox_backup::client::{backup_repo::BackupRepository, backup_writer::BackupWriter};
>   
>   use crate::{
>       KEYFILE_SCHEMA, REPO_URL_SCHEMA,
> diff --git a/src/bin/proxmox_backup_client/catalog.rs b/src/bin/proxmox_backup_client/catalog.rs
> index 1c0865e6..f9f88c87 100644
> --- a/src/bin/proxmox_backup_client/catalog.rs
> +++ b/src/bin/proxmox_backup_client/catalog.rs
> @@ -9,7 +9,7 @@ use proxmox::api::{api, cli::*};
>   
>   use proxmox_backup::tools;
>   
> -use proxmox_backup::client::*;
> +use proxmox_backup::client::{backup_reader::BackupReader, remote_chunk_reader::RemoteChunkReader};
>   
>   use crate::{
>       REPO_URL_SCHEMA,
> diff --git a/src/bin/proxmox_backup_client/mount.rs b/src/bin/proxmox_backup_client/mount.rs
> index 73bb8d4c..40af1740 100644
> --- a/src/bin/proxmox_backup_client/mount.rs
> +++ b/src/bin/proxmox_backup_client/mount.rs
> @@ -25,7 +25,7 @@ use proxmox_backup::backup::{
>       BufferedDynamicReader,
>   };
>   
> -use proxmox_backup::client::*;
> +use proxmox_backup::client::{backup_reader::BackupReader, remote_chunk_reader::RemoteChunkReader};
>   
>   use crate::{
>       REPO_URL_SCHEMA,
> diff --git a/src/bin/proxmox_backup_client/task.rs b/src/bin/proxmox_backup_client/task.rs
> index 96a28be9..55b58949 100644
> --- a/src/bin/proxmox_backup_client/task.rs
> +++ b/src/bin/proxmox_backup_client/task.rs
> @@ -5,7 +5,7 @@ use proxmox::api::{api, cli::*};
>   
>   use proxmox_backup::tools;
>   
> -use proxmox_backup::client::*;
> +use proxmox_backup::client::task_log::display_task_log;
>   use proxmox_backup::api2::types::UPID_SCHEMA;
>   
>   use crate::{
> diff --git a/src/client.rs b/src/client.rs
> index 3fb01f8a..9f649685 100644
> --- a/src/client.rs
> +++ b/src/client.rs
> @@ -6,28 +6,20 @@
>   mod merge_known_chunks;
>   pub mod pipe_to_stream;
>   
> -mod http_client;
> -pub use http_client::*;
> +pub mod http_client;
>   
> -mod task_log;
> -pub use task_log::*;
> +pub mod task_log;
>   
> -mod backup_reader;
> -pub use backup_reader::*;
> +pub mod backup_reader;
>   
> -mod backup_writer;
> -pub use backup_writer::*;
> +pub mod backup_writer;
>   
> -mod remote_chunk_reader;
> -pub use remote_chunk_reader::*;
> +pub mod remote_chunk_reader;
>   
> -mod pxar_backup_stream;
> -pub use pxar_backup_stream::*;
> +pub mod pxar_backup_stream;
>   
> -mod backup_repo;
> -pub use backup_repo::*;
> +pub mod backup_repo;
>   
> -mod backup_specification;
> -pub use backup_specification::*;
> +pub mod backup_specification;
>   
>   pub mod pull;
> diff --git a/src/client/backup_reader.rs b/src/client/backup_reader.rs
> index b0b43c38..9e058a0b 100644
> --- a/src/client/backup_reader.rs
> +++ b/src/client/backup_reader.rs
> @@ -12,7 +12,7 @@ use proxmox::tools::digest_to_hex;
>   
>   use crate::backup::*;
>   
> -use super::{HttpClient, H2Client};
> +use super::http_client::{HttpClient, H2Client};
>   
>   /// Backup Reader
>   pub struct BackupReader {
> diff --git a/src/client/backup_writer.rs b/src/client/backup_writer.rs
> index 17c09d77..e073f627 100644
> --- a/src/client/backup_writer.rs
> +++ b/src/client/backup_writer.rs
> @@ -17,7 +17,7 @@ use proxmox::tools::digest_to_hex;
>   use super::merge_known_chunks::{MergedChunkInfo, MergeKnownChunks};
>   use crate::backup::*;
>   
> -use super::{HttpClient, H2Client};
> +use super::http_client::{HttpClient, H2Client};
>   
>   pub struct BackupWriter {
>       h2: H2Client,
> diff --git a/src/client/pull.rs b/src/client/pull.rs
> index 5cf0dd1f..37e7b0c9 100644
> --- a/src/client/pull.rs
> +++ b/src/client/pull.rs
> @@ -11,7 +11,10 @@ use chrono::{Utc, TimeZone};
>   use crate::server::{WorkerTask};
>   use crate::backup::*;
>   use crate::api2::types::*;
> -use super::*;
> +use super::backup_reader::{compute_file_csum, BackupReader};
> +use super::backup_repo::BackupRepository;
> +use super::http_client::{HttpClient, HttpClientOptions};
> +use super::remote_chunk_reader::RemoteChunkReader;
>   
>   
>   // fixme: implement filters
> diff --git a/src/client/remote_chunk_reader.rs b/src/client/remote_chunk_reader.rs
> index eeb4851b..4e6583ee 100644
> --- a/src/client/remote_chunk_reader.rs
> +++ b/src/client/remote_chunk_reader.rs
> @@ -5,7 +5,7 @@ use std::sync::{Arc, Mutex};
>   
>   use anyhow::Error;
>   
> -use super::BackupReader;
> +use super::backup_reader::BackupReader;
>   use crate::backup::{AsyncReadChunk, CryptConfig, DataBlob, ReadChunk};
>   use crate::tools::runtime::block_on;
>   
> diff --git a/src/client/task_log.rs b/src/client/task_log.rs
> index 4db2a8e0..9d01537e 100644
> --- a/src/client/task_log.rs
> +++ b/src/client/task_log.rs
> @@ -1,7 +1,7 @@
>   use anyhow::{bail, Error};
>   use serde_json::json;
>   
> -use super::HttpClient;
> +use super::http_client::HttpClient;
>   
>   pub async fn display_task_log(
>       client: HttpClient,




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-17 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 15:43 [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client Mira Limbeck
2020-07-17 15:43 ` [pve-devel] [PATCH proxmox-backup 2/2] backup-client: change imports to not use '*' Mira Limbeck
2020-07-17 15:44 ` [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client Mira Limbeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal