mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-15 13:43:48 +08:00
发布v2.2.10版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
69
docs/guide-zh-CN/sys-library.md
Normal file
69
docs/guide-zh-CN/sys-library.md
Normal file
@@ -0,0 +1,69 @@
|
||||
## 消息队列
|
||||
|
||||
目录
|
||||
|
||||
- 缓存驱动
|
||||
- 上下文(待写)
|
||||
- JWT(待写)
|
||||
- 地理定位(待写)
|
||||
- 通知(待写)
|
||||
|
||||
|
||||
### 缓存驱动
|
||||
|
||||
> 系统默认的缓存驱动为file,目前已支持:memory|redis|file等多种驱动。请自行选择适合你的驱动使用。
|
||||
|
||||
- 配置文件:server/manifest/config/config.yaml
|
||||
|
||||
```yaml
|
||||
#缓存
|
||||
cache:
|
||||
adapter: "file" # 缓存驱动方式,支持:memory|redis|file,不填默认memory
|
||||
fileDir: "./storage/cache" # 文件缓存路径,adapter=file时必填
|
||||
```
|
||||
|
||||
#### 使用方式
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"hotgo/internal/library/cache"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
)
|
||||
|
||||
func test() {
|
||||
ctx := gctx.New()
|
||||
|
||||
// 添加/修改
|
||||
cache.Instance().Set(ctx, "qwe", 123, 0)
|
||||
|
||||
// 查询
|
||||
cache.Instance().Get(ctx, "qwe")
|
||||
|
||||
// 删除
|
||||
cache.Instance().Remove(ctx, "qwe")
|
||||
|
||||
// 更多方法请参考:https://goframe.org/pages/viewpage.action?pageId=27755640
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### 上下文
|
||||
```go
|
||||
// 待写
|
||||
```
|
||||
|
||||
### JWT
|
||||
```go
|
||||
// 待写
|
||||
```
|
||||
|
||||
### 地理定位
|
||||
```go
|
||||
// 待写
|
||||
```
|
||||
|
||||
### 通知
|
||||
```go
|
||||
// 待写
|
||||
```
|
||||
Reference in New Issue
Block a user