Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Nov 5, 2024
1 parent 2095277 commit 205378b
Show file tree
Hide file tree
Showing 100 changed files with 453 additions and 68 deletions.
6 changes: 5 additions & 1 deletion docs/docs/WEB服务开发/HTTPClient/HTTPClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,8 @@ func (r *Response) Close() error
1. `ghttp` 客户端默认关闭了 `KeepAlive` 功能以及对服务端 `TLS` 证书的校验功能,如果需要启用可自定义客户端的 `Transport` 属性。
2. **连接池参数设定**、 **连接代理设置** 等这些高级功能也可以通过自定义客户端的 `Transport` 属性实现,该数据继承于标准库的 `http.Transport` 对象。


## 相关文档

import DocCardList from '@theme/DocCardList';

<DocCardList />
8 changes: 7 additions & 1 deletion docs/docs/WEB服务开发/Session/Session.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ hide_title: true

## `Session` 的销毁/注销

用户 `Session` 不再使用,例如用户注销登录状态,需要从存储中硬删除,那么可以调用 `RemoveAll` 方法。
用户 `Session` 不再使用,例如用户注销登录状态,需要从存储中硬删除,那么可以调用 `RemoveAll` 方法。

## 相关文档

import DocCardList from '@theme/DocCardList';

<DocCardList />
5 changes: 4 additions & 1 deletion docs/docs/WEB服务开发/WEB服务开发.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ slug: '/docs/web'
title: 'WEB服务开发'
sidebar_position: 7
hide_title: true
---
---
import DocCardList from '@theme/DocCardList';

<DocCardList />
9 changes: 8 additions & 1 deletion docs/docs/WEB服务开发/分页管理/分页管理.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sidebar_position: 10
hide_title: true
---

## 基本介绍
分页管理由 `gpage` 模块实现, `gpage` 提供了强大的动态分页及静态分页功能,并且为开发者自定义分页样式提供了极高的灵活度。
:::tip
`gpage` 模块主要用于生成分页的HTML代码,常用于 `MVC` 开发场景。
Expand Down Expand Up @@ -71,4 +72,10 @@ function DoAjax(url) {
}
```

具体使用示例请查看后续章节。
具体使用示例请查看后续章节。

## 相关文档

import DocCardList from '@theme/DocCardList';

<DocCardList />
5 changes: 4 additions & 1 deletion docs/docs/WEB服务开发/接口文档/接口文档.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ hide_title: true

![](/markdown/487a4457a16a6cf2c86a7d706ce0d9cd.png)


## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
7 changes: 7 additions & 0 deletions docs/docs/WEB服务开发/数据返回/数据返回.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ sidebar_position: 4
hide_title: true
---


## 基本介绍

`HTTP Server` 的数据返回通过 `ghttp.Response` 对象实现, `ghttp.Response` 对象实现了标准库的 `http.ResponseWriter` 接口。数据输出使用 `Write*` 相关方法实现,并且数据输出采用了 `Buffer` 机制,因此数据的处理效率比较高。任何时候可以通过 `OutputBuffer` 方法输出缓冲区数据到客户端,并清空缓冲区数据。

常用方法:更详细的接口列表请参考 [https://pkg.go.dev/github.com/gogf/gf/v2/net/ghttp#Response](https://pkg.go.dev/github.com/gogf/gf/v2/net/ghttp#Response)
Expand Down Expand Up @@ -49,3 +52,7 @@ func (r *Response) WritelnExit(content ...interface{})
Response.Header().Set("Content-Type", "text/plain; charset=utf-8")
```

## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
3 changes: 3 additions & 0 deletions docs/docs/WEB服务开发/服务配置/服务配置.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ hide_title: true

`GoFrame` 框架的 `WebServer` 配置管理非常方便,支持通过配置文件配置、多种配置文件格式、多种配置方式以及若干配置方法。

import DocCardList from '@theme/DocCardList';

<DocCardList />
5 changes: 5 additions & 0 deletions docs/docs/WEB服务开发/请求输入/请求输入.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,8 @@ func main() {

即参数都是 `Body` 中提交的值,而不是路由参数中的值。其实, **由于参数大小写敏感的缘故**,服务端这个时候接受到了两个参数,一个是路由参数 `path`,一个是 `Body JSON` 提交的 `Path`。服务端在转换 `API` 参数对象的时候,由于属性 `Path``Body JSON` 中提交的 `Path` 更匹配,因此,使用的是 `Body JSON` 中的 `Path` 的值。

## 相关文档

import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ title: '路由管理-中间件/拦截器'
sidebar_position: 2
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sidebar_position: 3
hide_title: true
---

## 基本介绍

`v2.0` 版本开始,框架的 `Server` 组件额外提供了规范化的路由注册方式,更加适合团队规范化的使用场景、业务复杂度更高的项目。规范路由实现了以下特性:

Expand All @@ -18,4 +19,10 @@ hide_title: true
- 自动生成 `SwaggerUI` 页面
:::tip
注意一下哦: **规范路由** 与原有的 **函数、对象、分组** 路由方式都是框架的 `HTTP Server` 组件并存支持的路由注册方式,是为了解决一些规范化和自动化管理接口的场景,更适用于团队多人协作使用。其他的路由方式,特别是框架 `v1` 版本的函数、对象注册方式也是在新版本支持的哈!看个人使用习惯进行合理选择哟。
:::
:::

## 相关文档

import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ hide_title: true
## 注意事项

从框架 `v2` 版本开始,增加了 **规范路由** 的特性,更符合业务项目工程化的场景,推荐在复杂的业务项目中使用规范路由: [路由注册-规范路由](路由注册-规范路由/路由注册-规范路由.md)

## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
4 changes: 4 additions & 0 deletions docs/docs/WEB服务开发/路由管理/路由管理.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ hide_title: true
---

路由管理是 `HTTP Web Server` 开发的基础,我们尽可能地通过详尽的示例让您能更好理解本章节。

import DocCardList from '@theme/DocCardList';

<DocCardList />
3 changes: 3 additions & 0 deletions docs/docs/WEB服务开发/高级特性/高级特性.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ sidebar_position: 11
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
9 changes: 9 additions & 0 deletions docs/docs/其他资料/其他资料.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
slug: '/docs/other'
title: '其他资料'
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
10 changes: 10 additions & 0 deletions docs/docs/其他资料/准备工作/准备工作.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
slug: '/docs/install-go'
title: '准备工作'
sidebar_position: 0
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
2 changes: 1 addition & 1 deletion docs/docs/其他资料/准备工作/环境安装.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
slug: '/docs/install-go'
slug: '/docs/install-go/index'
title: '环境安装'
sidebar_position: 0
hide_title: true
Expand Down
6 changes: 5 additions & 1 deletion docs/docs/开发工具/代码生成-gen/代码生成-gen.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ DESCRIPTION
Please use "gf gen dao -h" for specified type help.
```
## 相关文档
import DocCardList from '@theme/DocCardList';
<DocCardList />
5 changes: 4 additions & 1 deletion docs/docs/开发工具/开发工具.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,7 @@ ADDITIONAL
Use "gf COMMAND -h" for details about a command.
```


## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
5 changes: 4 additions & 1 deletion docs/docs/微服务开发/微服务开发.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,7 @@ $ go run client.go
2023-03-14 20:52:37.060 [DEBU] {9898c809364a4c17da79e47f3e6c3b8f} Response: Hello World
```


## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
4 changes: 3 additions & 1 deletion docs/docs/服务可观测性/服务可观测性.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ hide_title: true

作为一款工程完备的开发框架,开发者通过 `GoFrame` 可以非常简便地实现服务的可观测特性。


import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ hide_title: true

开发者通过 `GoFrame` 框架可以快速地实现监控指标及指标暴露。


import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ hide_title: true

`GoFrame` 实现了标准化的分布式链路跟踪( `Distributed Tracing`)特性。


import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ hide_title: true

在本章节中,我们演示两个示例,一个用于演示 `baggage` 服务间上下文数据传递;一个用于演示较完整的 `HTTP+DB+Redis+Logging` 组件的链路跟踪。


import DocCardList from '@theme/DocCardList';

<DocCardList />
7 changes: 6 additions & 1 deletion docs/docs/核心组件/I18N国际化/I18N国际化.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ import "github.com/gogf/gf/v2/i18n/gi18n"

[https://pkg.go.dev/github.com/gogf/gf/v2/i18n/gi18n](https://pkg.go.dev/github.com/gogf/gf/v2/i18n/gi18n)



## 相关文档

import DocCardList from '@theme/DocCardList';

<DocCardList />
4 changes: 4 additions & 0 deletions docs/docs/核心组件/命令管理/命令管理.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ import "github.com/gogf/gf/v2/os/gcmd"
- `gcmd` 组件支持没有终端传参时通过配置组件读取参数方式。
- `gcmd` 组件支持链路跟踪,便于父子进程的链路信息传递。

## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ hide_title: true
:::
接口文档: [https://pkg.go.dev/github.com/gogf/gf/v2/database/gdb#TX](https://pkg.go.dev/github.com/gogf/gf/v2/database/gdb#TX)


import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ title: 'ORM使用配置'
sidebar_position: 0
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ type Driver interface {
}
```

其中的 `New` 方法用于根据 `Core` 数据库基础对象以及 `ConfigNode` 配置对象创建驱动对应的数据库操作对象,需要注意的是,返回的数据库对象需要实现 `DB` 接口。而数据库基础对象 `Core` 已经实现了 `DB` 接口,因此开发者只需要”继承” `Core` 对象,然后根据需要覆盖对应的接口实现方法即可。
其中的 `New` 方法用于根据 `Core` 数据库基础对象以及 `ConfigNode` 配置对象创建驱动对应的数据库操作对象,需要注意的是,返回的数据库对象需要实现 `DB` 接口。而数据库基础对象 `Core` 已经实现了 `DB` 接口,因此开发者只需要”继承” `Core` 对象,然后根据需要覆盖对应的接口实现方法即可。

## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ sidebar_position: 10
hide_title: true
---

## 基本介绍

数据库操作往往是业务项目中最复杂的部分, `GoFrame` 的数据库组件其实提供了非常强大和灵活的操作方式,我们在这里提供了一些最佳实践的案例,方便大家参考学习。


import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ title: 'ORM结果处理'
sidebar_position: 4
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ title: 'ORM链式操作-数据查询'
sidebar_position: 3
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ title: 'ORM链式操作-模型关联'
sidebar_position: 4
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ hide_title: true
| `dm` | 不支持 | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
| `clickhouse` | 不支持 | 不支持 | 不支持 | 不支持 | 支持 | 不支持 | 不支持 |


## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ title: 'ORM高级特性'
sidebar_position: 7
hide_title: true
---

import DocCardList from '@theme/DocCardList';

<DocCardList />
5 changes: 4 additions & 1 deletion docs/docs/核心组件/数据库ORM/数据库ORM.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,7 @@ db, err := gdb.Instance()
db, err := gdb.Instance("user")
```


## 相关文档
import DocCardList from '@theme/DocCardList';

<DocCardList />
Loading

0 comments on commit 205378b

Please sign in to comment.