Skip to content

Commit

Permalink
docs: update engine docs (#733)
Browse files Browse the repository at this point in the history
Co-authored-by: kinggo <[email protected]>
Co-authored-by: copy rogers <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2023
1 parent 9edbe05 commit d96c179
Show file tree
Hide file tree
Showing 6 changed files with 757 additions and 829 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ h.POST("/user", func(c context.Context, ctx *app.RequestContext) {

### SetFormValueFunc

Set the FormValue function.
If the default method provided by the [FormValue](#formvalue) function to obtain the value of the key does not meet the requirements, users can use this function to customize the method of obtaining the value of the key.

Function Signature:

Expand Down Expand Up @@ -1346,7 +1346,9 @@ h.Use(func(c context.Context, ctx *app.RequestContext) {

### SetClientIPFunc

Set the address of the client IP.
If the default method provided by the [ClientIP](#clientip) function does not meet the requirements, users can use this function to customize the way to obtain the client ip.

This function can be used in scenarios where you want to obtain an ip from the `X-Forwarded-For` or `X-Real-IP` header even if a remote ip exists (multiple proxies, want to obtain the initial ip from the `X-Forwarded-For` or `X-Real-IP` header).

Function Signature:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (ctx *RequestContext) AbortWithStatusJSON(code int, jsonObj interface{})

### SetBodyStream

Set Body Stream and optional Body Size.
Set Body Stream and optional Body Size. This function is used for streaming processing on Hertz Server, as detailed in [Streaming](/docs/hertz/tutorials/basic-feature/engine/#streaming).

> Note: When the bodySize is less than 0, all data is written. When it is greater than or equal to 0, data is written based on the set bodySize size.
Expand Down
Loading

1 comment on commit d96c179

@vercel
Copy link

@vercel vercel bot commented on d96c179 Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.