-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #47]Read configuration from environment variables #196
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,15 @@ pub(crate) mod common_remote { | |
|
||
/// env `NACOS_CLIENT_COMMON_THREAD_CORES` to set num when multi-cpus, default is num_cpus | ||
pub const ENV_NACOS_CLIENT_COMMON_THREAD_CORES: &str = "NACOS_CLIENT_COMMON_THREAD_CORES"; | ||
|
||
pub const ENV_NACOS_CLIENT_COMMON_SERVER_ADDRESS: &str = "nacos.client.server.address"; | ||
|
||
pub const ENV_NACOS_CLIENT_COMMON_SERVER_PORT: &str = "nacos.client.server.port"; | ||
|
||
pub const ENV_NACOS_CLIENT_COMMON_NAMESPACE: &str = "nacos.client.namespace"; | ||
|
||
pub const ENV_NACOS_CLIENT_COMMON_APP_NAME: &str = "nacos.client.app.name"; | ||
|
||
pub const ENV_NACOS_CLIENT_AUTH_USER_NAME: &str = "nacos.client.username"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 用大写下横线分割的如何? '.' 对于 shell 脚本也不友好。另外USERNAME 应该是可以连起来的英文字符 🫡 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@CherishCai
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mxsm 会不会太多方式造成理解成本大呢?不如先支持环境变量获取,后续真有需求再添加配置文件方式 |
||
|
||
pub const ENV_NACOS_CLIENT_AUTH_PASSWORD: &str = "nacos.client.password"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotenvy 建议仅用作测试用例,放于 dev-dependencies 下。