mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-08 14:23:13 +00:00
init: 结构修改
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
pub struct EndpointServerPools(Vec<PoolEndpoints>);
|
||||
|
||||
pub struct PoolEndpoints {
|
||||
// indicates if endpoints are provided in non-ellipses style
|
||||
pub legacy: bool,
|
||||
pub set_count: usize,
|
||||
pub drives_per_set: usize,
|
||||
pub endpoints: Endpoints,
|
||||
pub cmd_line: String,
|
||||
pub platform: String,
|
||||
}
|
||||
|
||||
pub struct Endpoints(Vec<Endpoint>);
|
||||
|
||||
pub struct Endpoint {
|
||||
pub url: url::Url,
|
||||
|
||||
pub is_local: bool,
|
||||
pub pool_idx: i32,
|
||||
pub set_idx: i32,
|
||||
pub disk_idx: i32,
|
||||
}
|
||||
+2
-14
@@ -1,14 +1,2 @@
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
}
|
||||
mod endpoint;
|
||||
mod store;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
use super::endpoint::Endpoint;
|
||||
|
||||
pub struct Store {
|
||||
pub id: uuid::Uuid,
|
||||
pub disks: Vec<Box<dyn DiskAPI>>,
|
||||
pub pools: Vec<Sets>,
|
||||
pub peer: Vec<String>,
|
||||
}
|
||||
|
||||
impl Store {}
|
||||
|
||||
pub struct Sets {
|
||||
pub sets: Vec<Objects>,
|
||||
}
|
||||
|
||||
pub struct Objects {
|
||||
pub endpoints: Vec<Endpoint>,
|
||||
pub disks: Vec<usize>,
|
||||
pub set_index: usize,
|
||||
pub pool_index: usize,
|
||||
pub set_drive_count: usize,
|
||||
pub default_parity_count: usize,
|
||||
}
|
||||
|
||||
trait DiskAPI {}
|
||||
|
||||
pub trait StorageAPI {}
|
||||
Reference in New Issue
Block a user