use std::str::FromStr; use giterated_api::DaemonConnectionPool; use giterated_models::{ instance::Instance, object_backend::ObjectBackend, user::{DisplayName, User}, }; use color_eyre::eyre::Result; use tracing::info; #[tokio::main] async fn main() -> Result<()> { tracing_subscriber::fmt::init(); color_eyre::install()?; let pool = DaemonConnectionPool::connect_other( Instance::from_str("giterated.dev")?, ("127.0.0.1:1111").parse().unwrap(), ) .unwrap(); let mut user = pool.get_object::("ambee:giterated.dev").await?; info!("Getting display name for {}!", user); let display_name = user.get::().await?; info!("{}'s display name is {}", user, display_name); let repositories = user .repositories(&Instance::from_str("giterated.dev").unwrap()) .await?; info!("Repository: {:#?}", repositories); Ok(()) }