-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9777a67
commit 6d001ef
Showing
101 changed files
with
834 additions
and
721 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,5 +1,5 @@ | ||
# Project | ||
/target | ||
target | ||
/.idea | ||
/.vscode | ||
|
||
|
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,9 @@ | ||
[package] | ||
name = "cds-assets" | ||
version = "0.0.1" | ||
edition = "2024" | ||
publish = false | ||
resolver = "2" | ||
|
||
[dependencies] | ||
rust-embed = { workspace = true } |
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,16 @@ | ||
[package] | ||
name = "cds-cache" | ||
version = "0.0.1" | ||
edition = "2024" | ||
publish = false | ||
resolver = "2" | ||
|
||
[dependencies] | ||
cds-env = {workspace = true} | ||
|
||
fred = { workspace = true } | ||
once_cell = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
tracing = { workspace = true } | ||
thiserror = { workspace = true } |
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
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,20 @@ | ||
[package] | ||
name = "cds-cluster" | ||
version = "0.0.1" | ||
edition = "2024" | ||
publish = false | ||
resolver = "2" | ||
|
||
[dependencies] | ||
cds-env = { workspace = true } | ||
cds-config = { workspace = true } | ||
cds-db = { workspace = true } | ||
|
||
kube = { workspace = true } | ||
k8s-openapi = { workspace = true } | ||
axum = { workspace = true } | ||
once_cell = { workspace = true } | ||
tokio-util = { workspace = true } | ||
tracing = { workspace = true } | ||
thiserror = { workspace = true } | ||
wsrx = { workspace = true } |
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
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,14 @@ | ||
[package] | ||
name = "cds-config" | ||
version = "0.0.1" | ||
edition = "2024" | ||
publish = false | ||
resolver = "2" | ||
|
||
[dependencies] | ||
cds-db = { workspace = true } | ||
cds-cache = { workspace = true } | ||
|
||
sea-orm = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
pub mod auth; | ||
pub mod cluster; | ||
pub mod site; | ||
pub mod traits; | ||
|
||
use cds_db::get_db; | ||
use sea_orm::EntityTrait; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize, Default)] | ||
pub struct Config { | ||
pub site: site::Config, | ||
pub auth: auth::Config, | ||
pub cluster: cluster::Config, | ||
} | ||
|
||
impl From<cds_db::entity::config::Model> for Config { | ||
fn from(config: cds_db::entity::config::Model) -> Self { | ||
serde_json::from_value::<Self>(config.value).unwrap() | ||
} | ||
} | ||
|
||
pub async fn init() { | ||
let config = cds_cache::get::<Config>("config").await.unwrap(); | ||
if config.is_none() { | ||
let model = cds_db::entity::config::Entity::find() | ||
.one(get_db()) | ||
.await | ||
.unwrap(); | ||
if let Some(model) = model { | ||
let _ = cds_cache::set("config", Config::from(model.clone())).await; | ||
} | ||
} | ||
} | ||
|
||
pub async fn get_config() -> Config { | ||
let config = cds_cache::get::<Config>("config").await.unwrap(); | ||
config.clone().unwrap() | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "cds-db" | ||
version = "0.0.1" | ||
edition = "2024" | ||
publish = false | ||
resolver = "2" | ||
|
||
[dependencies] | ||
cds-env = { workspace = true } | ||
cds-cache = { workspace = true } | ||
|
||
async-trait = { workspace = true } | ||
serde = { workspace = true } | ||
tracing = { workspace = true } | ||
sea-orm = { workspace = true } | ||
serde_repr = { workspace = true } | ||
once_cell = { workspace = true } | ||
chrono = { workspace = true } | ||
serde_json = { workspace = true } | ||
|
||
[lib] | ||
path = "src/lib.rs" |
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.