方便Python接入配置中心框架 Apollo 所开发的Python版本客户端。 Tested with python 3.7
pip install bp-apollo-client
- 启动客户端长连接监听
client = ApolloClient(app_id=<appId>, cluster=<clusterName>, config_server_url=<configServerUrl>)
client.client.add_callback_funcs(<cb_funs>) # 添加回调函数,回调函数接收一个参数为当前appId的配置
client.start()
- 获取Apollo的配置
client.get_value(Key, DefaultValue)
- Source Code: https://github.com/filamoon/pyapollo/
- Issue Tracker: https://github.com/filamoon/pyapollo/issues
The project is licensed under the Apache 2 license.
Apollo : https://github.com/ctripcorp/apollo