forked from ARK-Builders/ark-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- data-pdf - data-error - data-json - data-link - fs-storage - fs-atomic-light - data-json (ex fs-utils) - data-error (ex fs-utils)
- Loading branch information
1 parent
fb4df67
commit 1266e98
Showing
26 changed files
with
187 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
[workspace] | ||
members = [ | ||
"data-error", | ||
"data-json", | ||
"data-link", | ||
"data-pdf", | ||
"data-resource", | ||
"fs-atomic-versions", | ||
"fs-atomic-light", | ||
"fs-index", | ||
"fs-utils" | ||
"fs-storage", | ||
] | ||
|
||
default-members = [ | ||
"data-error", | ||
"data-json", | ||
"data-link", | ||
"data-pdf", | ||
"data-resource", | ||
"fs-atomic-versions", | ||
"fs-index", | ||
"fs-utils", | ||
"fs-storage", | ||
] | ||
|
||
resolver = "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
[package] | ||
name = "fs-utils" | ||
name = "data-error" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
||
[dependencies] | ||
thiserror = "1" | ||
reqwest = "0.11.11" | ||
serde_json = "1.0.82" | ||
anyhow = "1" | ||
url = { version = "2.2.2", features = ["serde"] } | ||
|
||
[dev-dependencies] | ||
rstest = "0.18" | ||
tempdir = "0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
use std::str::Utf8Error; | ||
|
||
use thiserror::Error; | ||
|
||
pub type Result<T> = std::result::Result<T, ArklibError>; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "data-json" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
||
[dependencies] | ||
serde_json = "1.0.82" | ||
|
||
[dev-dependencies] | ||
rstest = "0.18" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "data-link" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "data_link" | ||
crate-type = ["rlib"] | ||
bench = false | ||
|
||
[dependencies] | ||
fs-atomic-light = { path = "../fs-atomic-light" } | ||
fs-atomic-versions = { path = "../fs-atomic-versions" } | ||
fs-storage = { path = "../fs-storage" } | ||
data-resource = { path = "../data-resource" } | ||
data-error = { path = "../data-error" } | ||
|
||
log = { version = "0.4.17", features = ["release_max_level_off"] } | ||
serde_json = "1.0.82" | ||
serde = { version = "1.0.138", features = ["derive"] } | ||
url = { version = "2.2.2", features = ["serde"] } | ||
reqwest = "0.11.11" | ||
scraper = "0.13.0" | ||
tokio = { version = "1", features = ["full"] } | ||
|
||
[dev-dependencies] | ||
tempdir = "0.3.7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "data-pdf" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "data_pdf" | ||
crate-type = ["rlib"] | ||
bench = false | ||
|
||
[dependencies] | ||
once_cell = "1.16.0" | ||
image = "0.24.2" | ||
pdfium-render = { git = "https://github.com/ajrcarey/pdfium-render", rev = "d2559c1", features = [ | ||
"thread_safe", | ||
"sync", | ||
] } | ||
|
||
[dev-dependencies] | ||
tempdir = "0.3.7" | ||
|
||
[build-dependencies] | ||
flate2 = "1.0.24" | ||
fs_extra = "1.2.0" | ||
tar = "0.4.38" | ||
target-lexicon = "0.12.4" | ||
ureq = "2.4.0" | ||
ring = "=0.17.5" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "fs-atomic-light" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "fs_atomic_light" | ||
crate-type = ["rlib"] | ||
bench = false | ||
|
||
[dependencies] | ||
data-error = { path = "../data-error" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use data_error::Result; | ||
|
||
use std::env; | ||
use std::fs; | ||
use std::path::Path; | ||
use std::str; | ||
|
||
/// Write data to a tempory file and move that written file to destination | ||
/// | ||
/// May failed if writing or moving failed | ||
pub fn temp_and_move( | ||
data: &[u8], | ||
dest_dir: impl AsRef<Path>, | ||
filename: &str, | ||
) -> Result<()> { | ||
let mut path = env::temp_dir(); | ||
path.push(filename); | ||
|
||
fs::write(&path, data)?; | ||
fs::copy(path, dest_dir.as_ref().join(filename))?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.