diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 83cf322..0c323ae 100755 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -76,21 +76,29 @@ export default withPwa(defineConfig({ nav: [ { text: '指南', link: '/guide/' }, { text: 'API', link: '/api/' }, - { text: '插件', link: '/plugin/' }, + { text: '扩展', link: '/extension/' }, ], sidebar: { - '/plugin': [ + '/extension': [ { text: '扩展', items: [ + { + text: 'use-rabbitmq', + link: '/extension/rabbitmq', + }, + { + text: 'use-redis', + link: '/extension/redis', + }, { text: 'use-logger', - link: '/plugin/logger', + link: '/extension/logger', }, { text: 'use-notify', - link: '/plugin/notify', + link: '/extension/notify', } ], } diff --git a/docs/plugin/index.md b/docs/plugin/index.md index fb62513..f716b40 100644 --- a/docs/plugin/index.md +++ b/docs/plugin/index.md @@ -1,9 +1,10 @@ # 扩展 -大部分基础较为常用的功能内置于`usepy`中,但是有一些功能并不是所有人都需要,所以我们将这些功能放在了插件中,这样可以保证`usepy`更加轻量化。 +大部分基础较为常用的功能内置于`usepy`中,但是有一些功能并不是所有人都需要,所以我们将这些功能放在了扩展中,这样可以保证`usepy`更加轻量化。 ## 扩展列表 - [use-rabbitmq](rabbitmq.md) +- [use-redis](redis.md) - [use-logger](logger.md) - [use-notify](notify.md) diff --git a/docs/plugin/redis.md b/docs/plugin/redis.md new file mode 100644 index 0000000..84795fa --- /dev/null +++ b/docs/plugin/redis.md @@ -0,0 +1,35 @@ +--- +title: use-redis +outline: deep +--- + +# use-redis + +::: code-group + +```bash [pip] +pip install use-redis +``` +```bash [poetry] +poetry add use-redis +``` +::: + +一个永不断线的Redis连接管理 + + +### example + +```python +from use_redis import useRedis + +rds = useRedis() +``` + +if you use it with [usepy](https://github.com/use-py/usepy), you can use it like this: + +```python +from usepy.plugin import useRedis + +rds = useRedis() +```