pub async fn output(conf: &Config, region: &Region, mode: KongOutputMode) -> Result<()> {
    let data = generate_kong_output(conf, &region).await?;
    let output = match mode {
        KongOutputMode::Crd => {
            let res = KongCrdOutput::new(&region.name, data);
            serde_yaml::to_string(&res)?
        }
        KongOutputMode::Kongfig => {
            let res = KongfigOutput::new(data, region);
            serde_yaml::to_string(&res)?
        }
    };
    let _ = io::stdout().write(format!("{}\n", output).as_bytes());
    Ok(())
}
/// Generate Kong config from a filled in global config
Generate Kong config from a filled in global config
Generate Kong config from a filled in global config
pub async fn output(conf: &Config, region: &Region, mode: KongOutputMode) -> Result<()> {
    let data = generate_kong_output(conf, &region).await?;
    let output = match mode {
        KongOutputMode::Crd => {
            let res = KongCrdOutput::new(&region.name, data);
            serde_yaml::to_string(&res)?
        }
        KongOutputMode::Kongfig => {
            let res = KongfigOutput::new(data, region);
            serde_yaml::to_string(&res)?
        }
    };
    let _ = io::stdout().write(format!("{}\n", output).as_bytes());
    Ok(())
}
pub async fn output ( conf : & Config , region : & Region , mode : KongOutputMode ) -> Result < ( ) > { let data = generate_kong_output ( conf , & region ) . await ? ; let output = match mode { KongOutputMode :: Crd => { let res = KongCrdOutput :: new ( & region . name , data ) ; serde_yaml :: to_string ( & res ) ? } KongOutputMode :: Kongfig => { let res = KongfigOutput :: new ( data , region ) ; serde_yaml :: to_string ( & res ) ? } } ; let _ = io :: stdout ( ) . write ( format ! ( " \n " output ) . as_bytes ( ) ) ; Ok ( ( ) ) }
Generate Kong config from a filled in global config
Generate Kong config from a filled in global config
conf
&Config
region
&Region
mode
KongOutputMode
conf
&Config
region
&Region
mode
KongOutputMode