Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions content/en/docs/hertz/faq/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ For very vast requests cases, use a combination of streaming and go net.

If the framework reports the following error codes, you can check it for possible causes. If there is an error code other than the following, the error code is not caused by the framework and needs to be located by the user to see whether it is set by itself or by some middleware.

### 403

This status code is returned only when the `fs` feature is enabled and a directory index is accessed without permission. Hertz does not return `403` in other scenarios.

### 404

1. Access to the wrong port, commonly access to the debug port.
Expand All @@ -43,10 +47,18 @@ If the framework reports the following error codes, you can check it for possibl
1. Check whether all expected routes are registered correctly based on the startup log.
2. Check that the access method is correct.

### 413

The request body sent by the client exceeds the maximum size configured by [`WithMaxRequestBodySize`](../reference/config.md) on the server side. The default limit is 4 MB.

### 417

The server returns `false` after executing the custom `ContinueHandler` (the server actively rejects the subsequent body of the 100 Continue).

### 431

The request header sent by the client exceeds the maximum size configured by [`WithMaxHeaderBytes`](../reference/config.md) on the server side. The default limit is 1 MB.

### 500

1. Throwing the panic in middleware or in `handlerFunc`.
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/hertz/getting-started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: "Preparation of Hertz development environment, quick start, and bas
## Set Up Golang Development Environment

1. If you haven't set up your Golang environment yet, you can refer to [Golang Install](https://go.dev/doc/install).
2. We recommend that you use the latest version of Golang, or make sure it's >= v1.16. You can choose to use the earlier versions, but the compatibility and stability are not guaranteed.
2. We recommend that you use the latest version of Golang, or make sure it's >= v1.19. You can choose to use the earlier versions, but the compatibility and stability are not guaranteed.
3. Make sure the go mod support is enabled (for Golang versions >= v1.15, it is enabled by default).

> Currently, Hertz supports Linux, macOS, and Windows systems.
Expand Down
33 changes: 13 additions & 20 deletions content/en/docs/hertz/reference/config.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions content/en/docs/hertz/reference/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ description: "Hertz version description."

Hertz complies with the [Semantic Version 2.0.0](https://semver.org/lang/zh-CN/) release version.

**Current Version: [![Release](https://img.shields.io/github/v/release/cloudwego/hertz)](https://github.com/cloudwego/hertz/releases)**

- Master version number: Upgrade this version number if the API provided by Hertz becomes incompatible
- Secondary version number: Upgrade this version number when Hertz provides new features while maintaining backward compatibility
- Revision number: Upgrade this version number when Hertz's code provides minor features or backward-compatible optimizations and issue fixes

## Release Notes

See [GitHub Releases](https://github.com/cloudwego/hertz/releases).
4 changes: 2 additions & 2 deletions content/en/docs/hertz/tutorials/basic-feature/adaptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ func main() {

| Function | Function Signature | Description |
| ------------------ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| GetCompatRequest | `func GetCompatRequest(req *protocol.Request) (*http.Request, error)` | Build and fetch Go standard library `http.Request` from Hertz `protocol.Request` |
| ~~GetCompatRequest~~ | `func GetCompatRequest(req *protocol.Request) (*http.Request, error)` | **Deprecated: Please use [`adaptor.HertzHandler`](./http-adaptor.md) instead.** Build and fetch Go standard library `http.Request` from Hertz `protocol.Request` |
| CopyToHertzRequest | `func CopyToHertzRequest(req *http.Request, hreq *protocol.Request)` | Copy the `URI`, `Host`, `Method`, `Protocol`, `Header` of Go standard library `http.Request` to Hertz `protocol.Request`, The `Body` field will be adapted by sharing `Reader` |

## http.ResponseWriter

| Function / Struct | Function Signature | Description |
| ----------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| GetCompatResponseWriter | `func GetCompatResponseWriter(resp *protocol.Response) http.ResponseWriter` | Build and fetch Go standard library `http.ResponseWriter` from Hertz `protocol.Response` |
| ~~GetCompatResponseWriter~~ | `func GetCompatResponseWriter(resp *protocol.Response) http.ResponseWriter` | **Deprecated: Please use [`adaptor.HertzHandler`](./http-adaptor.md) instead.** Build and fetch Go standard library `http.ResponseWriter` from Hertz `protocol.Response` |
| compatResponse | / | `compatResponse` implements the `http.ResponseWriter` interface and has adaptations to `Header`, `Write` and `WriteHeader` functions |

## Handler
Expand Down
10 changes: 5 additions & 5 deletions content/en/docs/hertz/tutorials/basic-feature/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ func main() {
| **Option** | **Default** | **Description** |
| --------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| WithDialTimeout | 1s | dial timeout. |
| WithMaxConnsPerHost | 512 | maximum number of connections per host which may be established. |
| WithMaxConnsPerHost | 0 | maximum number of connections per host which may be established. Default 0 means unlimited. |
| WithMaxIdleConnDuration | 10s | max idle connection duration, idle keep-alive connections are closed after this duration. |
| WithMaxConnDuration | 0s | max connection duration, keep-alive connections are closed after this duration. |
| WithMaxConnWaitTimeout | 0s | maximum duration for waiting for a free connection. |
| WithKeepAlive | true | determines whether use keep-alive connection, default use. |
| WithClientReadTimeout | 0s | maximum duration for full response reading (including body). |
| WithClientReadTimeout | 0s | maximum duration for full response reading (including body). Default 0 means unlimited |
| WithTLSConfig | nil | tlsConfig to create a tls connection, for specific configuration information, please refer to [tls](/docs/hertz/tutorials/basic-feature/tls/). |
| WithDialer | network.Dialer | specific dialer. |
| WithDialer | network.Dialer | specific dialer. The default depends on platform: netpoll on linux/darwin with amd64/arm64 when `HERTZ_NO_NETPOLL=true` is not set; falls back to standard for TLS; standard otherwise. |
| WithResponseBodyStream | false | determine whether read body in stream or not, default not read in stream. |
| WithDisableHeaderNamesNormalizing | false | whether disable header names normalizing, default not disabled, for example, cONTENT-lenGTH -> Content-Length. |
| WithName | "" | set client name which used in User-Agent Header. |
| WithNoDefaultUserAgentHeader | false | whether default no User-Agent header, default with User-Agent header. |
| WithDisablePathNormalizing | false | whether disable path normalizing, default specification path, for example, http://localhost:8080/hello/../ hello -> http://localhost:8080/hello. |
| WithRetryConfig | nil | retry configuration, for specific configuration information, please refer to [retry](/docs/hertz/tutorials/basic-feature/retry/). |
| WithWriteTimeout | 0s | write timeout. |
| WithRetryConfig | nil | retry configuration. Not enabled by default; calling it sets `MaxAttemptTimes=1` (no retry). To enable retry, set explicitly. For details see [retry](/docs/hertz/tutorials/basic-feature/retry/). |
| WithWriteTimeout | 0s | write timeout. Default 0 means unlimited. |
| WithConnStateObserve | nil, 5s | set function to observe and record the connection status of HTTP client, as well as observe execution intervals. |
| WithDialFunc | network.Dialer | set dialer function. |
| WithHostClientConfigHook | nil | Set the hook function for re-configure the host client. |
Expand Down
Loading
Loading