ezconfig client
Project description
EZConfig 客户端程序
使用方法
pip install ezconfig-client
传入自定义参数,获取最新配置
from ezconfig_client import loader
res = loader.get_latest_config_by_params("DEV", "app_id", "secret", "https://xxxx.xxx.xxx")
print(res)
从环境变量中获取参数,从而获取配置的方法
from ezconfig_client import loader
res = loader.get_latest_config()
print(res)
使用前需要设置环境变量
环境变量 | 说明 |
---|---|
EZCONFIG_ENV | 环境变量 |
EZCONFIG_APPID | 应用ID |
EZCONFIG_SECRET | 应用密钥 |
EZCONFIG_HOST | EZConfig服务地址 |
环境依赖:
requests>=2.22.0
retrying>=1.3.4
测试参考代码
EZCONFIG_ENV=DEV EZCONFIG_APPID=xxx.xx.xxx EZCONFIG_SECRET=xxxxxxx EZCONFIG_HOST=https://xxxx.xx python test/test.py
版本说明
版本 | 变更 |
---|---|
0.4 | 降低requests版本,修改bug |
0.5 | 增加访问错误重试机制,请求超时30秒,失败重试3次 |
0.6 | 新增get_latest_config_by_params方法,传自定义参数获取最新配置,而不是走环境变量获取参数 |
0.7 | 去掉库里面的打印信息 |
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ezconfig-client-0.7.tar.gz
(4.0 kB
view details)
Built Distribution
File details
Details for the file ezconfig-client-0.7.tar.gz
.
File metadata
- Download URL: ezconfig-client-0.7.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 770ea35de02d1ec8cba7cbc7a10a85de2ea548bb0b15512fddd8fe084d8568f6 |
|
MD5 | 8c1815dde9a5678b40f5a30506a55ae2 |
|
BLAKE2b-256 | 0256346a4e819412d9b64713d659546758460d04fbb8306a8677e798774fa3d8 |
File details
Details for the file ezconfig_client-0.7-py3-none-any.whl
.
File metadata
- Download URL: ezconfig_client-0.7-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df4f2f61f4110c32f3252ea0d413e71fd595d6839df4ae1d8c4252f31bcc2473 |
|
MD5 | cabeabc9e3c1064c355869ec29392d00 |
|
BLAKE2b-256 | 60fc64bd50bd1d75821b1fb169250d86c9984fd6f09fc9fb0bf870e132a258c9 |