A Nacos discovery registry for Sanic
Project description
SANIC-NACOS
sanic extension for nacos service register.
Config
config | default | description |
---|---|---|
NACOS_SERVER_ADDR | 127.0.0.1:8848 | nacos server addr |
NACOS_ENABLE | TRUE | enable |
NACOS_AK | None | access key |
NACOS_SK | None | secret key |
NACOS_USERNAME | None | username |
NACOS_PASSWORD | None | password |
NACOS_NAMESPACE | public | namespace |
NACOS_GROUP | DEFAULT | group |
NACOS_CLUSTER_NAME | DEFAULT | cluster name |
NACOS_PREFER_SUBNET | 192.0.0.0/8 | if NACOS_SERVER_IP not present,node ip in this sub will be used |
NACOS_SERVICE_NAME | None | service name |
NACOS_SERVER_IP | None | server ip |
NACOS_SERVER_PORT | None | server port or else the port that app listening |
NACOS_HB_INTERVAL | 30 | nacos heartbeat interval |
NACOS_CONFIG_DATA_ID | None | nacos config data id |
NACOS_CONFIG_GROUP | DEFAULT_GROUP | nacos config group |
exapmle:
import sanic
from sanic_ext import Extend
from sanic_nacos import NacosExt
app = sanic.Sanic("sanic-nacos")
app.config.update({"NACOS_CONFIG_DATA_ID": "test.json"})
Extend.register(NacosExt)
if __name__ == '__main__':
app.run(port=9001)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sanic_nacos-1.0.0.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file sanic_nacos-1.0.0.tar.gz
.
File metadata
- Download URL: sanic_nacos-1.0.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3fe4fcc4fc5ce985a4e770e28af5568ef21f236cc81e50b66f6e64b166776c8 |
|
MD5 | 48b938177d9feb83b7c524e863d5060a |
|
BLAKE2b-256 | 6fda1f847ea18a7a93b7214d5c88b66eb98e99c7dd52a7e883051adf601225f6 |
File details
Details for the file sanic_nacos-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: sanic_nacos-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc128c0efe8e9e12a30653eb43921672f632938055e458008af508d11b8d0c8 |
|
MD5 | 20f953d650e2739c0cdd6ae7a55436b5 |
|
BLAKE2b-256 | 23302da9cc08ed105a8680dc7a7778c706aec7cb3993fb31f38872c2f771416b |