Metadata-Version: 2.1
Name: sanic-nacos
Version: 1.0.0
Summary: A Nacos discovery registry for Sanic
Author-email: renqiang <mail.renqiang@gmail.com>
License: MIT License
        
        Copyright (c) 2024 renz7
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Renz7/sanic_nacos
Project-URL: Issues, https://github.com/Renz7/sanic_nacos/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sanic
Requires-Dist: sanic-ext
Requires-Dist: nacos-sdk-python >=1.0.0

SANIC-NACOS

[sanic](https://sanic.dev/) extension for [nacos](https://nacos.io/) 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:

```python
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)

```
