sccc

Crates.iosccc
lib.rssccc
version0.1.0
sourcesrc
created_at2023-07-18 08:21:07.872251
updated_at2023-07-18 08:21:07.872251
descriptionSpring Cloud Config Server Reader
homepagehttps://github.com/zenas0810/sccc
repositoryhttps://github.com/zenas0810/sccc
max_upload_size
id919213
size17,190
Zenas (zenas0810)

documentation

https://github.com/zenas0810/sccc

README

Spring Cloud Config Reader

This is a simple crate to read configurations from a Spring Cloud Config server.

Usage

use {sccc::{Result,
            SCC},
     serde::Deserialize};

#[derive(Debug, Clone, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
struct PUSConf {
  pus: PUSApp,
}

#[derive(Debug, Clone, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
struct PUSApp {
  supported_profile_items: Vec<String>,
}

#[tokio::test]
async fn test_scc() -> Result<()> {
  let scc: SCC<PUSConf> = SCC::new("http://<username>:<password>@config.test2pay.com", "dev", "gp232_pus");
  let _ = scc.load().await?;
  let pus_conf = scc.get(|x| x.pus.clone()).await;
  println!("{:?}", pus_conf);
  Ok(())
}

Commit count: 3

cargo fmt