cloud_terrastodon_entrypoint 0.36.0

Main entrypoint for the Cloud Terrastodon CLI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use clap::Args;
use cloud_terrastodon_gitea::discover_and_track_tenants;
use eyre::Result;
use std::io::Write;

#[derive(Args, Debug, Clone)]
pub struct GiteaTenantDiscoverArgs {}

impl GiteaTenantDiscoverArgs {
    pub async fn invoke(self) -> Result<()> {
        let tenants = discover_and_track_tenants().await?;
        let stdout = std::io::stdout();
        let mut handle = stdout.lock();
        serde_json::to_writer_pretty(&mut handle, &tenants)?;
        handle.write_all(b"\n")?;
        Ok(())
    }
}