Skip to content

Commit 392066c

Browse files
committed
feat(config): Support for more configuration formats
1 parent 860a292 commit 392066c

6 files changed

Lines changed: 259 additions & 83 deletions

File tree

Cargo.lock

Lines changed: 150 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conreg-client/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "conreg-client"
3-
version = "0.2.0-beta.2"
3+
version = "0.2.0"
44
edition = "2024"
55
description = "Conreg is a distributed configuration and registration center similar to Nacos, and conreg client is conreg's client SDK"
66
license = "Apache-2.0"
@@ -11,6 +11,7 @@ documentation = "https://docs.rs/conreg-client"
1111
reqwest = { version = "0.13", features = ["json", "query", "multipart"] }
1212
serde = { version = "1.0.219", features = ["derive"] }
1313
serde_yaml = "0.9.33"
14+
config = { version = "0.15", default-features = false, features = ["yaml", "json", "toml", "ini"] }
1415
anyhow = "1"
1516
tokio = { version = "1.47.1", features = ["full"] }
1617
log = "0.4.28"

conreg-client/examples/client_register.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async fn main() {
3535
// 命名空间,可选,默认为 public
3636
.namespace("public")
3737
// 配置ID,如果有多个,后配置的会覆盖前面的同名配置项
38-
.config_ids(vec!["test.yaml".into()])
38+
.config_ids(vec!["test.yaml".into(),"test_json.json".into(),"test_properties.properties".into()])
3939
// 命名空间的认证Token,可选
4040
.auth_token(Some("token".to_string()))
4141
.build()

0 commit comments

Comments
 (0)