Skip to content
/ sccc Public

The crate for read configuration from Spring Cloud Config Server

License

Notifications You must be signed in to change notification settings

zenas0810/sccc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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(())
}

About

The crate for read configuration from Spring Cloud Config Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages