mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-02-21 18:15:50 +08:00
📝 Docs: 添加 localstore 插件配置 (#3197)
This commit is contained in:
parent
a63322633a
commit
19d9014279
@ -111,3 +111,45 @@ LOCALSTORE_DATA_DIR=/tmp/data
|
||||
```dotenv
|
||||
LOCALSTORE_CONFIG_DIR=/tmp/config
|
||||
```
|
||||
|
||||
### localstore_plugin_cache_dir
|
||||
|
||||
自定义插件缓存目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CACHE_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_cache"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_data_dir
|
||||
|
||||
自定义插件数据目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_DATA_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_data"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_config_dir
|
||||
|
||||
自定义插件配置目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CONFIG_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_config"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
@ -59,3 +59,97 @@ data_file.write_text("Hello World!")
|
||||
# 读取文件内容
|
||||
data = data_file.read_text()
|
||||
```
|
||||
|
||||
:::note 提示
|
||||
|
||||
对于嵌套插件,子插件的存储目录将位于父插件存储目录下。
|
||||
|
||||
:::
|
||||
|
||||
## 配置项
|
||||
|
||||
### localstore_cache_dir
|
||||
|
||||
自定义缓存目录
|
||||
|
||||
默认值:
|
||||
|
||||
- macOS: `~/Library/Caches/<AppName>`
|
||||
- Unix: `~/.cache/<AppName>` (XDG default)
|
||||
- Windows: `C:\Users\<username>\AppData\Local\<AppName>\Cache`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_CACHE_DIR=/tmp/cache
|
||||
```
|
||||
|
||||
### localstore_data_dir
|
||||
|
||||
自定义数据目录
|
||||
|
||||
默认值:
|
||||
|
||||
- macOS: `~/Library/Application Support/<AppName>`
|
||||
- Unix: `~/.local/share/<AppName>` or in $XDG_DATA_HOME, if defined
|
||||
- Win XP (not roaming): `C:\Documents and Settings\<username>\Application Data\<AppName>`
|
||||
- Win 7 (not roaming): `C:\Users\<username>\AppData\Local\<AppName>`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_DATA_DIR=/tmp/data
|
||||
```
|
||||
|
||||
### localstore_config_dir
|
||||
|
||||
自定义配置目录
|
||||
|
||||
默认值:
|
||||
|
||||
- macOS: same as user_data_dir
|
||||
- Unix: `~/.config/<AppName>`
|
||||
- Win XP (roaming): `C:\Documents and Settings\<username>\Local Settings\Application Data\<AppName>`
|
||||
- Win 7 (roaming): `C:\Users\<username>\AppData\Roaming\<AppName>`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_CONFIG_DIR=/tmp/config
|
||||
```
|
||||
|
||||
### localstore_plugin_cache_dir
|
||||
|
||||
自定义插件缓存目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CACHE_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_cache"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_data_dir
|
||||
|
||||
自定义插件数据目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_DATA_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_data"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_config_dir
|
||||
|
||||
自定义插件配置目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CONFIG_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_config"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
@ -59,3 +59,97 @@ data_file.write_text("Hello World!")
|
||||
# 读取文件内容
|
||||
data = data_file.read_text()
|
||||
```
|
||||
|
||||
:::note 提示
|
||||
|
||||
对于嵌套插件,子插件的存储目录将位于父插件存储目录下。
|
||||
|
||||
:::
|
||||
|
||||
## 配置项
|
||||
|
||||
### localstore_cache_dir
|
||||
|
||||
自定义缓存目录
|
||||
|
||||
默认值:
|
||||
|
||||
- macOS: `~/Library/Caches/<AppName>`
|
||||
- Unix: `~/.cache/<AppName>` (XDG default)
|
||||
- Windows: `C:\Users\<username>\AppData\Local\<AppName>\Cache`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_CACHE_DIR=/tmp/cache
|
||||
```
|
||||
|
||||
### localstore_data_dir
|
||||
|
||||
自定义数据目录
|
||||
|
||||
默认值:
|
||||
|
||||
- macOS: `~/Library/Application Support/<AppName>`
|
||||
- Unix: `~/.local/share/<AppName>` or in $XDG_DATA_HOME, if defined
|
||||
- Win XP (not roaming): `C:\Documents and Settings\<username>\Application Data\<AppName>`
|
||||
- Win 7 (not roaming): `C:\Users\<username>\AppData\Local\<AppName>`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_DATA_DIR=/tmp/data
|
||||
```
|
||||
|
||||
### localstore_config_dir
|
||||
|
||||
自定义配置目录
|
||||
|
||||
默认值:
|
||||
|
||||
- macOS: same as user_data_dir
|
||||
- Unix: `~/.config/<AppName>`
|
||||
- Win XP (roaming): `C:\Documents and Settings\<username>\Local Settings\Application Data\<AppName>`
|
||||
- Win 7 (roaming): `C:\Users\<username>\AppData\Roaming\<AppName>`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_CONFIG_DIR=/tmp/config
|
||||
```
|
||||
|
||||
### localstore_plugin_cache_dir
|
||||
|
||||
自定义插件缓存目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CACHE_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_cache"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_data_dir
|
||||
|
||||
自定义插件数据目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_DATA_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_data"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_config_dir
|
||||
|
||||
自定义插件配置目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CONFIG_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_config"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
@ -111,3 +111,45 @@ LOCALSTORE_DATA_DIR=/tmp/data
|
||||
```dotenv
|
||||
LOCALSTORE_CONFIG_DIR=/tmp/config
|
||||
```
|
||||
|
||||
### localstore_plugin_cache_dir
|
||||
|
||||
自定义插件缓存目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CACHE_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_cache"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_data_dir
|
||||
|
||||
自定义插件数据目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_DATA_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_data"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_config_dir
|
||||
|
||||
自定义插件配置目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CONFIG_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_config"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
@ -111,3 +111,45 @@ LOCALSTORE_DATA_DIR=/tmp/data
|
||||
```dotenv
|
||||
LOCALSTORE_CONFIG_DIR=/tmp/config
|
||||
```
|
||||
|
||||
### localstore_plugin_cache_dir
|
||||
|
||||
自定义插件缓存目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CACHE_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_cache"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_data_dir
|
||||
|
||||
自定义插件数据目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_DATA_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_data"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
||||
### localstore_plugin_config_dir
|
||||
|
||||
自定义插件配置目录
|
||||
|
||||
默认值:`{}`
|
||||
|
||||
```dotenv
|
||||
LOCALSTORE_PLUGIN_CONFIG_DIR='
|
||||
{
|
||||
"plugin_id": "/tmp/plugin_config"
|
||||
}
|
||||
'
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user