Skip to content

Commit 3d59b54

Browse files
authored
docs: update form's format of client.md doc (#793)
1 parent ee16d07 commit 3d59b54

File tree

2 files changed

+37
-37
lines changed
  • content
    • en/docs/hertz/tutorials/basic-feature
    • zh/docs/hertz/tutorials/basic-feature

2 files changed

+37
-37
lines changed

content/en/docs/hertz/tutorials/basic-feature/client.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,26 @@ func main() {
4646

4747
## Client Config
4848

49-
| **Option** | **Default** | **Description** |
50-
| ----------------------------- | -------------- | ------------------------------------------------------------ |
51-
| WithDialTimeout | 1s | dial timeout. |
49+
| **Option** | **Default** | **Description** |
50+
|-----------------------------------| -------------- |-----------------|
51+
| WithDialTimeout | 1s | dial timeout. |
5252
| WithMaxConnsPerHost | 512 | maximum number of connections per host which may be established. |
5353
| WithMaxIdleConnDuration | 10s | max idle connection duration, idle keep-alive connections are closed after this duration. |
5454
| WithMaxConnDuration | 0s | max connection duration, keep-alive connections are closed after this duration. |
55-
| WithMaxConnWaitTimeout | 0s | maximum duration for waiting for a free connection. |
56-
| WithKeepAlive | true | determines whether use keep-alive connection, default use. |
57-
| WithClientReadTimeout | 0s | maximum duration for full response reading (including body). |
58-
| WithTLSConfig | nil | tlsConfig to create a tls connection, for specific configuration information, please refer to [tls](/docs/hertz/tutorials/basic-feature/protocol/tls/). |
59-
| WithDialer | network.Dialer | specific dialer. |
60-
| WithResponseBodyStream | false | determine whether read body in stream or not, default not read in stream. |
61-
| WithDisableHeaderNamesNormalizing | false | whether disable header names normalizing, default not disabled, for example, cONTENT-lenGTH -> Content-Length. |
62-
| WithName | "" | client name which used in User-Agent Header. |
63-
| WithNoDefaultUserAgentHeader | false | whether no default User-Agent header, default with User-Agent header. |
64-
| WithDisablePathNormalizing | false | whether disable path normalizing, default specification path, for example, http://localhost:8080/hello/../ hello -> http://localhost:8080/hello. |
65-
| WithRetryConfig | nil | retry configuration, for specific configuration information, please refer to [retry](/docs/hertz/tutorials/basic-feature/retry/). |
66-
| WithWriteTimeout | 0s | write timeout. |
67-
| WithConnStateObserve | nil, 5s | set function to observe and record the connection status of HTTP client, as well as observe execution intervals. |
68-
| WithDialFunc | network.Dialer | set dialer function. |
55+
| WithMaxConnWaitTimeout | 0s | maximum duration for waiting for a free connection. |
56+
| WithKeepAlive | true | determines whether use keep-alive connection, default use. |
57+
| WithClientReadTimeout | 0s | maximum duration for full response reading (including body). |
58+
| WithTLSConfig | nil | tlsConfig to create a tls connection, for specific configuration information, please refer to [tls](/docs/hertz/tutorials/basic-feature/protocol/tls/). |
59+
| WithDialer | network.Dialer | specific dialer. |
60+
| WithResponseBodyStream | false | determine whether read body in stream or not, default not read in stream. |
61+
| WithDisableHeaderNamesNormalizing | false | whether disable header names normalizing, default not disabled, for example, cONTENT-lenGTH -> Content-Length. |
62+
| WithName | "" | client name which used in User-Agent Header. |
63+
| WithNoDefaultUserAgentHeader | false | whether no default User-Agent header, default with User-Agent header. |
64+
| WithDisablePathNormalizing | false | whether disable path normalizing, default specification path, for example, http://localhost:8080/hello/../ hello -> http://localhost:8080/hello. |
65+
| WithRetryConfig | nil | retry configuration, for specific configuration information, please refer to [retry](/docs/hertz/tutorials/basic-feature/retry/). |
66+
| WithWriteTimeout | 0s | write timeout. |
67+
| WithConnStateObserve | nil, 5s | set function to observe and record the connection status of HTTP client, as well as observe execution intervals. |
68+
| WithDialFunc | network.Dialer | set dialer function. |
6969

7070
Sample Code:
7171

content/zh/docs/hertz/tutorials/basic-feature/client.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,26 @@ func main() {
4444

4545
## Client 配置
4646

47-
| 配置项 | 默认值 | 描述 |
48-
| ----------------------------- | -------------- | ------------------------------------------------------- |
49-
| WithDialTimeout | 1s | 拨号超时时间 |
50-
| WithMaxConnsPerHost | 512 | 每个主机可能建立的最大连接数 |
51-
| WithMaxIdleConnDuration | 10s | 最大的空闲连接持续时间,空闲的连接在此持续时间后被关闭 |
52-
| WithMaxConnDuration | 0s | 最大的连接持续时间,keep-alive 连接在此持续时间后被关闭 |
53-
| WithMaxConnWaitTimeout | 0s | 等待空闲连接的最大时间 |
54-
| WithKeepAlive | true | 是否使用 keep-alive 连接,默认使用 |
55-
| WithClientReadTimeout | 0s | 完整读取响应(包括 body)的最大持续时间 |
56-
| WithTLSConfig | nil | 设置用于创建 tls 连接的 tlsConfig,具体配置信息请看 [tls](/zh/docs/hertz/tutorials/basic-feature/protocol/tls/) |
57-
| WithDialer | network.Dialer | 设置指定的拨号器 |
58-
| WithResponseBodyStream | false | 是否在流中读取 body,默认不在流中读取 |
59-
| WithDisableHeaderNamesNormalizing | false | 是否禁用头名称规范化,默认不禁用,如 cONTENT-lenGTH -> Content-Length |
60-
| WithName | "" | 用户代理头中使用的客户端名称 |
61-
| WithNoDefaultUserAgentHeader | false | 是否没有默认的 User-Agent 头,默认有 User-Agent 头 |
62-
| WithDisablePathNormalizing | false | 是否禁用路径规范化,默认规范路径,如 http://localhost:8080/hello/../ hello -> http://localhost:8080/hello |
63-
| WithRetryConfig | nil | HTTP 客户端的重试配置,重试配置详细说明请看 [重试](/zh/docs/hertz/tutorials/basic-feature/retry/) |
64-
| WithWriteTimeout | 0s | HTTP 客户端的写入超时时间 |
65-
| WithConnStateObserve | nil, 5s | 设置观察和记录 HTTP 客户端的连接状态的函数以及观察执行间隔 |
66-
| WithDialFunc | network.Dialer | 设置 HTTP 客户端拨号器函数,会覆盖自定义拨号器 |
47+
| 配置项 | 默认值 | 描述 |
48+
|------------------------------------| -------------- | ---- |
49+
| WithDialTimeout | 1s | 拨号超时时间 |
50+
| WithMaxConnsPerHost | 512 | 每个主机可能建立的最大连接数 |
51+
| WithMaxIdleConnDuration | 10s | 最大的空闲连接持续时间,空闲的连接在此持续时间后被关闭 |
52+
| WithMaxConnDuration | 0s | 最大的连接持续时间,keep-alive 连接在此持续时间后被关闭 |
53+
| WithMaxConnWaitTimeout | 0s | 等待空闲连接的最大时间 |
54+
| WithKeepAlive | true | 是否使用 keep-alive 连接,默认使用 |
55+
| WithClientReadTimeout | 0s | 完整读取响应(包括 body)的最大持续时间 |
56+
| WithTLSConfig | nil | 设置用于创建 tls 连接的 tlsConfig,具体配置信息请看 [tls](/zh/docs/hertz/tutorials/basic-feature/protocol/tls/) |
57+
| WithDialer | network.Dialer | 设置指定的拨号器 |
58+
| WithResponseBodyStream | false | 是否在流中读取 body,默认不在流中读取 |
59+
| WithDisableHeaderNamesNormalizing | false | 是否禁用头名称规范化,默认不禁用,如 cONTENT-lenGTH -> Content-Length |
60+
| WithName | "" | 用户代理头中使用的客户端名称 |
61+
| WithNoDefaultUserAgentHeader | false | 是否没有默认的 User-Agent 头,默认有 User-Agent 头 |
62+
| WithDisablePathNormalizing | false | 是否禁用路径规范化,默认规范路径,如 http://localhost:8080/hello/../ hello -> http://localhost:8080/hello |
63+
| WithRetryConfig | nil | HTTP 客户端的重试配置,重试配置详细说明请看 [重试](/zh/docs/hertz/tutorials/basic-feature/retry/) |
64+
| WithWriteTimeout | 0s | HTTP 客户端的写入超时时间 |
65+
| WithConnStateObserve | nil, 5s | 设置观察和记录 HTTP 客户端的连接状态的函数以及观察执行间隔 |
66+
| WithDialFunc | network.Dialer | 设置 HTTP 客户端拨号器函数,会覆盖自定义拨号器 |
6767

6868
示例代码:
6969

0 commit comments

Comments
 (0)