Remove gtk stuff and add a socket crate

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent a2c6e4cdf1
commit 17e6e04dd3

File diff suppressed because it is too large Load Diff

@ -6,3 +6,16 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
[dependencies.mediarepo-core]
path = "./mediarepo-core"
[dependencies.mediarepo-database]
path = "./mediarepo-database"
[dependencies.mediarepo-socket]
path = "./mediarepo-socket"
[dependencies.tokio]
version = "1.12.0"
features = ["macros", "rt-multi-thread"]

@ -464,6 +464,16 @@ dependencies = [
"unicode-normalization",
]
[[package]]
name = "indexmap"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "instant"
version = "0.1.11"
@ -762,9 +772,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "sea-orm"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dccf21195a4f7f744e3799fba57222e59b0134dcc88c38343bbce59e88af6b5b"
checksum = "e715900921a367b557c9f5b5b5f554f514130d104c5ec1b555dfccc0e11a90e8"
dependencies = [
"async-stream",
"async-trait",
@ -888,9 +898,9 @@ dependencies = [
[[package]]
name = "sqlx"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4b94ab0f8c21ee4899b93b06451ef5d965f1a355982ee73684338228498440"
checksum = "7911b0031a0247af40095838002999c7a52fba29d9739e93326e71a5a1bc9d43"
dependencies = [
"sqlx-core",
"sqlx-macros",
@ -898,9 +908,9 @@ dependencies = [
[[package]]
name = "sqlx-core"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec28b91a01e1fe286d6ba66f68289a2286df023fc97444e1fd86c2fd6d5dc026"
checksum = "aec89bfaca8f7737439bad16d52b07f1ccd0730520d3bf6ae9d069fe4b641fb1"
dependencies = [
"ahash",
"atoi",
@ -918,6 +928,7 @@ dependencies = [
"futures-util",
"hashlink",
"hex",
"indexmap",
"itoa",
"libc",
"log",
@ -937,13 +948,12 @@ dependencies = [
[[package]]
name = "sqlx-macros"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dc33c35d54774eed73d54568d47a6ac099aed8af5e1556a017c131be88217d5"
checksum = "584866c833511b1a152e87a7ee20dee2739746f60c858b3c5209150bc4b466f5"
dependencies = [
"dotenv",
"either",
"futures",
"heck",
"once_cell",
"proc-macro2",
@ -957,9 +967,9 @@ dependencies = [
[[package]]
name = "sqlx-rt"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14302b678d9c76b28f2e60115211e25e0aabc938269991745a169753dc00e35c"
checksum = "0d1bd069de53442e7a320f525a6d4deb8bb0621ac7a55f7eccbc2b58b57f43d0"
[[package]]
name = "stringprep"

@ -12,9 +12,11 @@ multibase = "0.9.1"
base64 = "0.13.0"
[dependencies.sea-orm]
version = "0.2.4"
default-features = false
[dependencies.sqlx]
version = "0.5.9"
default-features = false
features = ["migrate"]

@ -0,0 +1,10 @@
use crate::settings::Settings;
use sea_orm::DatabaseConnection;
use std::sync::Arc;
use tokio::sync::Mutex;
#[derive(Clone, Default)]
pub struct Context {
pub settings: Arc<Mutex<Settings>>,
pub database: DatabaseConnection,
}

@ -1,2 +1,4 @@
pub mod context;
pub mod error;
pub mod file_hash_store;
pub mod settings;

@ -0,0 +1,16 @@
#[derive(Clone, Debug)]
pub struct Settings {
pub repo_path: String,
pub database_path: String,
pub default_file_store: String,
}
impl Default for Settings {
fn default() -> Self {
Self {
repo_path: "".to_string(),
database_path: "".to_string(),
default_file_store: "".to_string(),
}
}
}

@ -1092,9 +1092,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "sea-orm"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dccf21195a4f7f744e3799fba57222e59b0134dcc88c38343bbce59e88af6b5b"
checksum = "e715900921a367b557c9f5b5b5f554f514130d104c5ec1b555dfccc0e11a90e8"
dependencies = [
"async-stream",
"async-trait",
@ -1113,9 +1113,9 @@ dependencies = [
[[package]]
name = "sea-orm-macros"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0cdadaa6fbb88f6cfffe1cb0cc842ad4bca9dc030438c9f826023ff71fb75ff"
checksum = "82b6f4cdd6d918845980bd3572f55f95d9c79a9c2352192f33bca99d91ca350a"
dependencies = [
"bae",
"convert_case",
@ -1277,9 +1277,9 @@ dependencies = [
[[package]]
name = "sqlx"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4b94ab0f8c21ee4899b93b06451ef5d965f1a355982ee73684338228498440"
checksum = "7911b0031a0247af40095838002999c7a52fba29d9739e93326e71a5a1bc9d43"
dependencies = [
"sqlx-core",
"sqlx-macros",
@ -1287,9 +1287,9 @@ dependencies = [
[[package]]
name = "sqlx-core"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec28b91a01e1fe286d6ba66f68289a2286df023fc97444e1fd86c2fd6d5dc026"
checksum = "aec89bfaca8f7737439bad16d52b07f1ccd0730520d3bf6ae9d069fe4b641fb1"
dependencies = [
"ahash",
"atoi",
@ -1308,6 +1308,7 @@ dependencies = [
"futures-util",
"hashlink",
"hex",
"indexmap",
"itoa",
"libc",
"libsqlite3-sys",
@ -1334,13 +1335,12 @@ dependencies = [
[[package]]
name = "sqlx-macros"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dc33c35d54774eed73d54568d47a6ac099aed8af5e1556a017c131be88217d5"
checksum = "584866c833511b1a152e87a7ee20dee2739746f60c858b3c5209150bc4b466f5"
dependencies = [
"dotenv",
"either",
"futures",
"heck",
"once_cell",
"proc-macro2",
@ -1355,9 +1355,9 @@ dependencies = [
[[package]]
name = "sqlx-rt"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14302b678d9c76b28f2e60115211e25e0aabc938269991745a169753dc00e35c"
checksum = "0d1bd069de53442e7a320f525a6d4deb8bb0621ac7a55f7eccbc2b58b57f43d0"
dependencies = [
"native-tls",
"once_cell",

@ -1288,9 +1288,9 @@ dependencies = [
[[package]]
name = "sqlx"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4b94ab0f8c21ee4899b93b06451ef5d965f1a355982ee73684338228498440"
checksum = "7911b0031a0247af40095838002999c7a52fba29d9739e93326e71a5a1bc9d43"
dependencies = [
"sqlx-core",
"sqlx-macros",
@ -1298,9 +1298,9 @@ dependencies = [
[[package]]
name = "sqlx-core"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec28b91a01e1fe286d6ba66f68289a2286df023fc97444e1fd86c2fd6d5dc026"
checksum = "aec89bfaca8f7737439bad16d52b07f1ccd0730520d3bf6ae9d069fe4b641fb1"
dependencies = [
"ahash",
"atoi",
@ -1319,6 +1319,7 @@ dependencies = [
"futures-util",
"hashlink",
"hex",
"indexmap",
"itoa",
"libc",
"libsqlite3-sys",
@ -1345,13 +1346,12 @@ dependencies = [
[[package]]
name = "sqlx-macros"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dc33c35d54774eed73d54568d47a6ac099aed8af5e1556a017c131be88217d5"
checksum = "584866c833511b1a152e87a7ee20dee2739746f60c858b3c5209150bc4b466f5"
dependencies = [
"dotenv",
"either",
"futures",
"heck",
"once_cell",
"proc-macro2",
@ -1366,9 +1366,9 @@ dependencies = [
[[package]]
name = "sqlx-rt"
version = "0.5.7"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14302b678d9c76b28f2e60115211e25e0aabc938269991745a169753dc00e35c"
checksum = "0d1bd069de53442e7a320f525a6d4deb8bb0621ac7a55f7eccbc2b58b57f43d0"
dependencies = [
"native-tls",
"once_cell",

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "mediarepo-socket"
version = "0.1.0"

@ -0,0 +1,13 @@
[package]
name = "mediarepo-socket"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rmp-ipc = "0.2.1"
[dependencies.tokio]
version = "1.12.0"
features = ["net"]

@ -0,0 +1,7 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}

@ -1,3 +1,2 @@
fn main() {
println!("Hello, world!");
}
#[tokio::main]
async fn main() {}

Loading…
Cancel
Save