Skip to content

Commit

Permalink
add redis
Browse files Browse the repository at this point in the history
  • Loading branch information
mic1on committed Nov 29, 2023
1 parent bbe408f commit d77ce89
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
16 changes: 12 additions & 4 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
],
}
Expand Down
3 changes: 2 additions & 1 deletion docs/plugin/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# 扩展

大部分基础较为常用的功能内置于`usepy`中,但是有一些功能并不是所有人都需要,所以我们将这些功能放在了插件中,这样可以保证`usepy`更加轻量化。
大部分基础较为常用的功能内置于`usepy`中,但是有一些功能并不是所有人都需要,所以我们将这些功能放在了扩展中,这样可以保证`usepy`更加轻量化。

## 扩展列表

- [use-rabbitmq](rabbitmq.md)
- [use-redis](redis.md)
- [use-logger](logger.md)
- [use-notify](notify.md)
35 changes: 35 additions & 0 deletions docs/plugin/redis.md
Original file line number Diff line number Diff line change
@@ -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()
```

0 comments on commit d77ce89

Please sign in to comment.