mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 11:56:38 +00:00
init:store
This commit is contained in:
+9
-16
@@ -8,23 +8,16 @@ rust-version.workspace = true
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
||||
[[bin]]
|
||||
name = "rustfs"
|
||||
# required-features = ["binary"]
|
||||
|
||||
|
||||
# [features]
|
||||
# binary = ["tokio/full", "dep:clap", "dep:tracing-subscriber", "dep:hyper-util"]
|
||||
|
||||
[dependencies]
|
||||
ecstore = { path = "../ecstore" }
|
||||
clap = { version = "4.5.7", features = ["derive"] }
|
||||
s3s = { version = "0.10.0" }
|
||||
anyhow = { version = "1.0.86" }
|
||||
tracing = { workspace = true }
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "time"] }
|
||||
async-trait.workspace = true
|
||||
tracing.workspace = true
|
||||
anyhow.workspace = true
|
||||
time = { workspace = true, features = ["parsing", "formatting"] }
|
||||
async-trait = { workspace = true }
|
||||
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "net", "signal"] }
|
||||
|
||||
ecstore = { path = "../ecstore" }
|
||||
|
||||
s3s = "0.10.0"
|
||||
clap = { version = "4.5.7", features = ["derive"] }
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "time"] }
|
||||
hyper-util = { version = "0.1.5", features = ["tokio", "server-auto", "server-graceful"] }
|
||||
|
||||
+3
-5
@@ -3,7 +3,6 @@ mod storage;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use ecstore::store::ECStore;
|
||||
use hyper_util::{
|
||||
rt::{TokioExecutor, TokioIo},
|
||||
server::conn::auto::Builder as ConnBuilder,
|
||||
@@ -39,10 +38,9 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
debug!("opt: {:?}", &opt);
|
||||
// Setup S3 service
|
||||
let service = {
|
||||
let mut b = S3ServiceBuilder::new(storage::ecfs::FS::new(
|
||||
opt.address.clone(),
|
||||
opt.volumes.clone(),
|
||||
)?);
|
||||
let mut b = S3ServiceBuilder::new(
|
||||
storage::ecfs::FS::new(opt.address.clone(), opt.volumes.clone()).await?,
|
||||
);
|
||||
|
||||
// Enable authentication
|
||||
if let (Some(ak), Some(sk)) = (opt.access_key, opt.secret_key) {
|
||||
|
||||
@@ -15,8 +15,8 @@ pub struct FS {
|
||||
}
|
||||
|
||||
impl FS {
|
||||
pub fn new(address: String, endpoints: Vec<String>) -> Result<Self> {
|
||||
let store: ECStore = ECStore::new(address, endpoints)?;
|
||||
pub async fn new(address: String, endpoints: Vec<String>) -> Result<Self> {
|
||||
let store: ECStore = ECStore::new(address, endpoints).await?;
|
||||
Ok(Self { store })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
pub mod ecfs;
|
||||
mod simple_fs;
|
||||
|
||||
pub use simple_fs::SimpleFS;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
use s3s::S3;
|
||||
|
||||
pub struct SimpleFS {}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl S3 for SimpleFS {}
|
||||
Reference in New Issue
Block a user