refactor: rename rfs-client to sal-rfs-client and integrate with workspace dependencies

This commit is contained in:
Sameh Abouel-saad 2025-06-24 17:47:50 +03:00
parent b02101bd42
commit b81a0aa61c
11 changed files with 36 additions and 36 deletions

View File

@ -11,17 +11,18 @@ categories = ["os", "filesystem", "api-bindings"]
readme = "README.md"
[workspace]
members = [".", "vault", "git", "redisclient", "mycelium", "text", "os", "net", "zinit_client", "process", "virt", "postgresclient", "rhai", "herodo"]
members = [".", "vault", "git", "redisclient", "mycelium", "text", "os", "net", "zinit_client", "process", "virt", "postgresclient", "rhai", "herodo", "rfs-client"]
resolver = "2"
[workspace.metadata]
# Workspace-level metadata
rust-version = "1.70.0"
rust-version = "1.85.0"
[workspace.dependencies]
# Core shared dependencies with consistent versions
anyhow = "1.0.98"
base64 = "0.22.1"
bytes = "1.4.0"
dirs = "6.0.0"
env_logger = "0.11.8"
futures = "0.3.30"
@ -84,3 +85,4 @@ sal-virt = { path = "virt" }
sal-postgresclient = { path = "postgresclient" }
sal-vault = { path = "vault" }
sal-rhai = { path = "rhai" }
sal-rfs-client = { path = "rfs-client" }

View File

@ -1,18 +1,21 @@
[package]
name = "rfs-client"
name = "sal-rfs-client"
version = "0.1.0"
edition = "2021"
description = "Client library for RFS (Remote File System) server"
license = "MIT"
description = "SAL RFS Client - Client library for Remote File System server"
repository = "https://git.threefold.info/herocode/sal"
license = "Apache-2.0"
keywords = ["rfs", "client", "filesystem", "remote"]
categories = ["filesystem", "api-bindings"]
[dependencies]
openapi = { path = "./openapi" }
thiserror = "1.0"
url = "2.4"
reqwest = { version = "^0.12", features = ["json", "multipart"] }
tokio = { version = "1.28", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
log = "0.4"
bytes = "1.4"
futures = "0.3"
thiserror.workspace = true
url.workspace = true
reqwest = { workspace = true, features = ["json", "multipart"] }
tokio = { workspace = true, features = ["full"] }
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
log.workspace = true
bytes.workspace = true
futures.workspace = true

View File

@ -1,5 +1,5 @@
use rfs_client::RfsClient;
use rfs_client::types::{ClientConfig, Credentials};
use sal_rfs_client::RfsClient;
use sal_rfs_client::types::{ClientConfig, Credentials};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {

View File

@ -1,5 +1,5 @@
use rfs_client::RfsClient;
use rfs_client::types::{ClientConfig, Credentials};
use sal_rfs_client::RfsClient;
use sal_rfs_client::types::{ClientConfig, Credentials};
use openapi::models::{VerifyBlock, VerifyBlocksRequest};
#[tokio::main]

View File

@ -1,5 +1,5 @@
use rfs_client::RfsClient;
use rfs_client::types::{ClientConfig, Credentials, UploadOptions, DownloadOptions};
use sal_rfs_client::RfsClient;
use sal_rfs_client::types::{ClientConfig, Credentials, UploadOptions, DownloadOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {

View File

@ -1,6 +1,5 @@
use rfs_client::RfsClient;
use rfs_client::types::{ClientConfig, Credentials, FlistOptions, WaitOptions};
use std::path::Path;
use sal_rfs_client::RfsClient;
use sal_rfs_client::types::{ClientConfig, Credentials, FlistOptions, WaitOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {

View File

@ -1,5 +1,5 @@
use rfs_client::RfsClient;
use rfs_client::types::{ClientConfig, Credentials, WaitOptions};
use sal_rfs_client::RfsClient;
use sal_rfs_client::types::{ClientConfig, Credentials, WaitOptions};
use openapi::models::FlistState;
#[tokio::main]

View File

@ -1,3 +0,0 @@
[toolchain]
channel = "1.82.0"

View File

@ -12,8 +12,8 @@ use openapi::{
},
models::{
SignInBody, ListBlocksParams,
VerifyBlocksRequest, VerifyBlocksResponse, VerifyBlock, FlistBody, UserBlocksResponse, BlockDownloadsResponse,
BlocksResponse, PreviewResponse, FileInfo, FlistState, ResponseResult, FlistStateResponse, BlockUploadedResponse, FileUploadResponse,
VerifyBlocksRequest, VerifyBlocksResponse, FlistBody, UserBlocksResponse, BlockDownloadsResponse,
BlocksResponse, PreviewResponse, FileInfo, FlistState, FlistStateResponse,
},
};
@ -122,12 +122,7 @@ impl RfsClient {
.map_err(map_openapi_error)?;
// Extract the file hash from the response
match result {
FileUploadResponse { file_hash, .. } => {
Ok(file_hash.clone())
},
_ => Err(RfsError::Other("Unexpected response type from file upload".to_string())),
}
Ok(result.file_hash.clone())
}
/// Download a file from the RFS server

3
rust-toolchain.toml Normal file
View File

@ -0,0 +1,3 @@
[toolchain]
channel = "1.85.0"

View File

@ -43,6 +43,7 @@ pub use sal_os as os;
pub use sal_postgresclient as postgresclient;
pub use sal_process as process;
pub use sal_redisclient as redisclient;
pub use sal_rfs_client as rfs_client;
pub use sal_rhai as rhai;
pub use sal_text as text;
pub use sal_vault as vault;