Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
gaby and coderabbitai[bot] authored Jul 6, 2024
1 parent c92a9af commit 7d30a4e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions addon/retry/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Retry Addon

Retry addon for [Fiber](https://github.com/gofiber/fiber) designed to apply retry mechanism for unsuccessful network
operations. This addon uses exponential backoff algorithm with jitter. It calls the function multiple times and tries
to make it successful. If all calls are failed, then, it returns error. It adds a jitter at each retry step because adding
operations. This addon uses an exponential backoff algorithm with jitter. It calls the function multiple times and tries
to make it successful. If all calls are failed, then, it returns an error. It adds a jitter at each retry step because adding
a jitter is a way to break synchronization across the client and avoid collision.

## Table of Contents
Expand Down
9 changes: 4 additions & 5 deletions binder/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fiber Binders

Binder is new request/response binding feature for Fiber. By aganist old Fiber parsers, it supports custom binder registration, struct validation, `map[string]string`, `map[string][]string` and more. It's introduced in Fiber v3 and a replacement of:
Binder is a new request/response binding feature for Fiber. Against the old Fiber parsers, it supports custom binder registration, struct validation, `map[string]string`, `map[string][]string`, and more. It's introduced in Fiber v3 and a replacement of:

- BodyParser
- ParamsParser
Expand All @@ -25,7 +25,7 @@ Binder is new request/response binding feature for Fiber. By aganist old Fiber p

### Binding into the Struct

Fiber supports binding into the struct with [gorilla/schema](https://github.com/gorilla/schema). Here's an example for it:
Fiber supports binding into the struct with [gorilla/schema](https://github.com/gorilla/schema). Here's an example:

```go
// Field names should start with an uppercase letter
Expand Down Expand Up @@ -62,8 +62,7 @@ app.Post("/", func(c fiber.Ctx) error {

### Binding into the Map

Fiber supports binding into the `map[string]string` or `map[string][]string`. Here's an example for it:

Fiber supports binding into the `map[string]string` or `map[string][]string`. Here's an example:
```go

Check failure on line 66 in binder/README.md

View workflow job for this annotation

GitHub Actions / markdownlint

Fenced code blocks should be surrounded by blank lines

binder/README.md:66 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```go"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md
app.Get("/", func(c fiber.Ctx) error {
p := make(map[string][]string)
Expand Down Expand Up @@ -115,7 +114,7 @@ app.Get("/", func(c fiber.Ctx) error {

### Defining Custom Binder

We didn't add much binder to make Fiber codebase minimal. But if you want to use your binders, it's easy to register and use them. Here's an example for TOML binder.
We didn't add much binder to make Fiber codebase minimal. If you want to use your own binders, it's easy to register and use them. Here's an example for TOML binder.

```go
type Person struct {
Expand Down
2 changes: 1 addition & 1 deletion docs/api/bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ app.Post("/", func(c fiber.Ctx) error {

Binds the request xml form body to a struct.

It is important to specify the correct struct tag based on the content type to be parsed. For example, if you want to parse a XML body with a field called Pass, you would use a struct field of `xml:"pass"`.
It is important to specify the correct struct tag based on the content type to be parsed. For example, if you want to parse an XML body with a field called Pass, you would use a struct field of `xml:"pass"`.

```go title="Signature"
func (b *Bind) XML(out any) error
Expand Down
2 changes: 1 addition & 1 deletion docs/api/fiber.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ app.Listen(":8080", fiber.ListenConfig{
| <Reference id="listeneraddrfunc">ListenerAddrFunc</Reference> | `func(addr net.Addr)` | Allows accessing and customizing `net.Listener`. | `nil` |
| <Reference id="listenernetwork">ListenerNetwork</Reference> | `string` | Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only). WARNING: When prefork is set to true, only "tcp4" and "tcp6" can be chosen. | `tcp4` |
| <Reference id="onshutdownerror">OnShutdownError</Reference> | `func(err error)` | Allows to customize error behavior when gracefully shutting down the server by given signal. Prints error with `log.Fatalf()` | `nil` |
| <Reference id="onshutdownsuccess">OnShutdownSuccess</Reference> | `func()` | Allows to customize success behavior when gracefully shutting down the server by given signal. | `nil` |
| <Reference id="onshutdownsuccess">OnShutdownSuccess</Reference> | `func()` | Allows customizing success behavior when gracefully shutting down the server by given signal. | `nil` |
| <Reference id="tlsconfigfunc">TLSConfigFunc</Reference> | `func(tlsConfig *tls.Config)` | Allows customizing `tls.Config` as you want. | `nil` |

### Listen
Expand Down
4 changes: 2 additions & 2 deletions docs/api/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 7
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of this hooks:
With Fiber v2.30.0, you can execute custom user functions when to run some methods. Here is a list of these hooks:

- [OnRoute](#onroute)
- [OnName](#onname)
Expand Down Expand Up @@ -217,4 +217,4 @@ func main() {
</Tabs>

:::caution
OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app and you mount it; paths of routes and groups will start with mount prefix.
OnName/OnRoute/OnGroup/OnGroupName hooks are mount-sensitive. If you use one of these routes on sub app, and you mount it; paths of routes and groups will start with mount prefix.
2 changes: 1 addition & 1 deletion docs/middleware/limiter.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ app.Use(limiter.New(limiter.Config{
}))
```

This means that every window will take into account the previous window(if there was any). The given formula for the rate is:
This means that every window will consider the previous window (if there was any). The given formula for the rate is:

```text
weightOfPreviousWindpw = previous window's amount request * (whenNewWindow / Expiration)
Expand Down

0 comments on commit 7d30a4e

Please sign in to comment.