-
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.
- Loading branch information
1 parent
6b575f6
commit 36a6387
Showing
16 changed files
with
115 additions
and
3,724 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,3 +1,5 @@ | ||
pub mod router; | ||
|
||
use whcore::type_map; | ||
|
||
type_map! {} |
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,25 @@ | ||
use std::sync::Arc; | ||
|
||
use data::prisma::{PrismaClient, instance, installed_mod}; | ||
use rpc_rs::{prisma_module, prisma_module_filtered, Router}; | ||
|
||
pub fn build_router() -> Router<Arc<PrismaClient>> { | ||
let mut router = Router::new(); | ||
|
||
prisma_module!(router += ["instance", "instances"] { | ||
client: PrismaClient, | ||
module: instance, | ||
container: instance, | ||
primary_key: id, | ||
}); | ||
|
||
prisma_module_filtered!(router += ["mod", "mods"] { | ||
client: PrismaClient, | ||
module: installed_mod, | ||
container: installed_mod, | ||
primary_key: id, | ||
filter: instance_id = i32, | ||
}); | ||
|
||
router | ||
} |
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,3 +1,5 @@ | ||
pub mod into_async; | ||
pub mod runnable; | ||
|
||
pub use into_async::*; | ||
pub use runnable::*; |
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,6 @@ | ||
use anyhow::Result; | ||
|
||
#[async_trait] | ||
pub trait Runnable { | ||
async fn run(&self) -> Result<()>; | ||
} |
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.