use std::str::FromStr; use giterated_issues::operations::CreateIssueRequest; use giterated_models::{repository::Repository, user::User}; use giterated_plugin::{handle::PluginHandle, new_stack::Runtime}; use tracing::Level; #[tokio::main] pub async fn main() { tracing_subscriber::fmt() .pretty() .with_thread_names(true) .with_max_level(Level::TRACE) .init(); let handle = PluginHandle::from_dylib("giterated_issues.dll").unwrap(); let mut runtime = Runtime::new(); runtime.insert_plugin(handle); let operation = CreateIssueRequest { name: String::from("test issue"), contents: String::from("hey!"), author: User::from_str("amber:giterated.dev").unwrap(), }; match runtime.handle_typed( Repository::from_str("barson:giterated.dev/foo@giterated.dev").unwrap(), operation, ) { Ok(success) => { println!("Success in create issue: {:?}", success) } Err(err) => { println!("Error in create issue: {:?}", err) } } }