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 |
exapmle:
import sanic
from sanic_nacos import NacosExt
app = sanic.Sanic(__name__)
from sanic_ext import Extend
Extend.register(NacosExt)
if __name__ == '__main__':
app.run(host="0.0.0.0", 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-0.0.1.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file sanic_nacos-0.0.1.tar.gz
.
File metadata
- Download URL: sanic_nacos-0.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9294a8e1baa424872d31fbf7227e1c4c8acc2762c3dd0f4c7789564df203dc7 |
|
MD5 | c410a19b1663ed1cda9359bb035d2b51 |
|
BLAKE2b-256 | f41f827bed8952d57c91101367ba68e1022c712aa3e71779cc06397564f6d2a6 |
File details
Details for the file sanic_nacos-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: sanic_nacos-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a890be6a17c49c6218ef96bd5cbff467ddfe9167590cc46e21c11332513679f5 |
|
MD5 | c26ceee4bad81d1192a9fd9e4131894a |
|
BLAKE2b-256 | 32e4415d73bc5a5ca52a5877457a3fb32b6f5db9c4216147cd751819f7d6309c |