Skip to content

Commit

Permalink
factor a crate fs-metadata out of fs-storage
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Mar 12, 2024
1 parent bcbaace commit 8490c03
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"data-resource",
"fs-atomic-versions",
"fs-atomic-light",
"fs-metadata",
"fs-index",
"fs-storage",
]
Expand All @@ -18,6 +19,8 @@ default-members = [
"data-pdf",
"data-resource",
"fs-atomic-versions",
"fs-atomic-light",
"fs-metadata",
"fs-index",
"fs-storage",
]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The purpose of the library is to manage _resource index_ of folders with various
| `data-resource` | Resource hashing and ID construction |
| `fs-index` | Resource Index construction and updating |
| `fs-storage` | Filesystem storage for resources |
| `fs-metadata` | Metadata management |
| `data-link` | Linking resources |
| `data-pdf` | PDF handling |
| `data-error` | Error handling |
Expand Down
1 change: 1 addition & 0 deletions data-link/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ crate-type = ["rlib"]
fs-atomic-light = { path = "../fs-atomic-light" }
fs-atomic-versions = { path = "../fs-atomic-versions" }
fs-storage = { path = "../fs-storage" }
fs-metadata = { path = "../fs-metadata" }
data-resource = { path = "../data-resource" }
data-error = { path = "../data-error" }

Expand Down
2 changes: 1 addition & 1 deletion data-link/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use data_error::Result;
use data_resource::ResourceId;
use fs_atomic_versions::atomic::AtomicFile;
use fs_storage::meta::store_metadata;
use fs_metadata::store_metadata;
use fs_storage::prop::load_raw_properties;
use fs_storage::prop::store_properties;
use fs_storage::{
Expand Down
17 changes: 17 additions & 0 deletions fs-metadata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "fs-metadata"
version = "0.1.0"
edition = "2021"


[dependencies]
data-error = { path = "../data-error" }
fs-atomic-versions = { path = "../fs-atomic-versions" }
data-resource = { path = "../data-resource" }
fs-storage = { path = "../fs-storage" }
serde = { version = "1.0.138", features = ["derive"] }

[dev-dependencies]
log = { version = "0.4.17", features = ["release_max_level_off"] }
tempdir = "0.3.7"
serde_json = "1.0.82"
4 changes: 3 additions & 1 deletion fs-storage/src/meta.rs → fs-metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ use std::fmt::Debug;
use std::io::Read;
use std::path::Path;

use crate::{ARK_FOLDER, METADATA_STORAGE_FOLDER};
use data_resource::ResourceId;
use fs_storage::ARK_FOLDER;

pub const METADATA_STORAGE_FOLDER: &str = "cache/metadata";

pub fn store_metadata<
S: Serialize + DeserializeOwned + Clone + Debug,
Expand Down
2 changes: 0 additions & 2 deletions fs-storage/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod meta;
pub mod prop;

pub const ARK_FOLDER: &str = ".ark";
Expand All @@ -14,6 +13,5 @@ pub const PROPERTIES_STORAGE_FOLDER: &str = "user/properties";

// Generated data
pub const INDEX_PATH: &str = "index";
pub const METADATA_STORAGE_FOLDER: &str = "cache/metadata";
pub const PREVIEWS_STORAGE_FOLDER: &str = "cache/previews";
pub const THUMBNAILS_STORAGE_FOLDER: &str = "cache/thumbnails";

0 comments on commit 8490c03

Please sign in to comment.