Skip to main content

starmerx apollo client

Project description

#Starmerx Apollo Client

##项目介绍

本项目是Apollo的Client端, 用来获取Apollo配置。 本项目采用长连接, 保持心跳并从ApolloConfig获取配置 获取配置后, 会备份一本在本地磁盘, 和缓存(不是正经缓存, 就是一个类变量) 配置读取顺序:

  1. 缓存
  2. 网络请求
  3. 本地配置

##使用介绍

使用时建议采用单例模式, 全局使用一个实例, Demo如下:

from starmerx_apollo_client.apollo_client import ApolloClient from utils.env import env

CONFIG_URL = env.get_value('APOLLO_CONFIG_URL', default='') APP_ID = env.get_value('APOLLO_APP_ID', default='') APP_SECRET = env.get_value('APOLLO_APP_SECRET', default='')

a_client = ApolloClient(app_id=APP_ID, secret=APP_SECRET, config_url=CONFIG_URL)

##遗留问题

暂只支持python3 长链接那里目前使用没有问题, 后续需要跟进

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

starmerx_apollo_client-0.0.4.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

starmerx_apollo_client-0.0.4-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file starmerx_apollo_client-0.0.4.tar.gz.

File metadata

  • Download URL: starmerx_apollo_client-0.0.4.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.3

File hashes

Hashes for starmerx_apollo_client-0.0.4.tar.gz
Algorithm Hash digest
SHA256 0620a482f035b9e3cf71d3f9cccb4f1d70444e8db34a48b47092dab9e315bcc0
MD5 811136fcec4963f7ea32b5ed571fcb05
BLAKE2b-256 6e753635808088f933727f76c05422e112fdabef088573a14903eabdf83cab89

See more details on using hashes here.

File details

Details for the file starmerx_apollo_client-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for starmerx_apollo_client-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f4c930d1cbc916e1d69a67529f363f72ee3ad8af615f24960421a138056d1e45
MD5 5a5d397aba9344af83ca161df3f4677d
BLAKE2b-256 eb89a9c9397b578a824d2ac58675a072cfb46063e4baa2c653a328a70e280e85

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page