From 4fd4fbfb0887a825578d3481304067af24d85dea Mon Sep 17 00:00:00 2001 From: nonebot Date: Sat, 6 Feb 2021 03:44:30 +0000 Subject: [PATCH] :memo: update api docs --- docs/api/README.md | 3 ++ docs/api/drivers/quart.md | 62 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 docs/api/drivers/quart.md diff --git a/docs/api/README.md b/docs/api/README.md index 36e9803e..e12dd0ff 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -43,6 +43,9 @@ * [nonebot.drivers.fastapi](drivers/fastapi.html) + * [nonebot.drivers.quart](drivers/quart.html) + + * [nonebot.adapters](adapters/) diff --git a/docs/api/drivers/quart.md b/docs/api/drivers/quart.md new file mode 100644 index 00000000..068769e0 --- /dev/null +++ b/docs/api/drivers/quart.md @@ -0,0 +1,62 @@ +--- +contentSidebar: true +sidebarDepth: 0 +--- + +# NoneBot.drivers.quart 模块 + +## Quart 驱动适配 + +后端使用方法请参考: [Quart 文档](https://pgjones.gitlab.io/quart/index.html) + + +## _class_ `Driver` + +基类:[`nonebot.drivers.Driver`](README.md#nonebot.drivers.Driver) + +Quart 驱动框架 + + +* **上报地址** + + + * `/{adapter name}/http`: HTTP POST 上报 + + + * `/{adapter name}/ws`: WebSocket 上报 + + + +### _property_ `type` + +驱动名称: `quart` + + +### _property_ `server_app` + +`Quart` 对象 + + +### _property_ `asgi` + +`Quart` 对象 + + +### _property_ `logger` + +fastapi 使用的 logger + + +### `on_startup(func)` + +参考文档: [Startup and Shutdown](https://pgjones.gitlab.io/quart/how_to_guides/startup_shutdown.html) + + +### `on_shutdown(func)` + +参考文档: [Startup and Shutdown](https://pgjones.gitlab.io/quart/how_to_guides/startup_shutdown.html) + + +### `run(host=None, port=None, *, app=None, **kwargs)` + +使用 `uvicorn` 启动 Quart