JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Fucking whatever there you go

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨57c2ca5

⁨plugins/giterated-issues/src/main.rs⁩ - ⁨1207⁩ bytes
Raw
1 use std::str::FromStr;
2
3 use giterated_issues::operations::CreateIssueRequest;
4 use giterated_models::{
5 instance::Instance,
6 object::{GiteratedObject, ObjectRequest},
7 operation::GiteratedOperation,
8 repository::Repository,
9 user::User,
10 };
11 use giterated_plugin::{handle::PluginHandle, new_stack::Runtime};
12 use tracing::Level;
13
14 #[tokio::main]
15 pub async fn main() {
16 tracing_subscriber::fmt()
17 .pretty()
18 .with_thread_names(true)
19 .with_max_level(Level::TRACE)
20 .init();
21
22 let mut handle = PluginHandle::from_dylib("giterated_issues.dll").unwrap();
23
24 let mut runtime = Runtime::<()>::new();
25
26 runtime.insert_plugin(handle);
27
28 let operation = CreateIssueRequest {
29 name: String::from("test issue"),
30 contents: String::from("hey!"),
31 author: User::from_str("amber:giterated.dev").unwrap(),
32 };
33
34 match runtime.handle_typed(
35 Repository::from_str("barson:giterated.dev/[email protected]").unwrap(),
36 operation,
37 ) {
38 Ok(success) => {
39 println!("Success in create issue: {:?}", success)
40 }
41 Err(err) => {
42 println!("Error in create issue: {:?}", err)
43 }
44 }
45 }
46