diff --git a/docs/api/client.md b/docs/api/client.md index ffbe308f94..4b52d72cab 100644 --- a/docs/api/client.md +++ b/docs/api/client.md @@ -537,7 +537,8 @@ agent.SetResponse(resp) ReleaseResponse(resp) ``` -
Example handling for response values +
+Example handling for response values ```go title="Example handling response" // Create a Fiber HTTP client agent diff --git a/docs/api/middleware/logger.md b/docs/api/middleware/logger.md index 0a23441aa3..596ace3fe6 100644 --- a/docs/api/middleware/logger.md +++ b/docs/api/middleware/logger.md @@ -92,20 +92,19 @@ app.Use(logger.New(logger.Config{ ### Config -| Property | Type | Description | Default | -|:-----------------|:---------------------------|:---------------------------------------------------------------------------------------------------------------------------------|:-------------------------| -| Next | `func(*fiber.Ctx) bool` | Next defines a function to skip this middleware when returned true. | `nil` | -| Done | `func(*fiber.Ctx, []byte)` | Done is a function that is called after the log string for a request is written to Output, and pass the log string as parameter. | `nil` | -| CustomTags | `map[string]LogFunc` | tagFunctions defines the custom tag action. | `map[string]LogFunc` | -| Format | `string` | Format defines the logging tags. | `${time} | ${status} | ${latency} | ${ip} | ${method} | ${path} | ${error}\n` | -| TimeFormat | `string` | TimeFormat defines the time format for log timestamps. | `15:04:05` | -| TimeZone | `string` | TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc | `"Local"` | -| TimeInterval | `time.Duration` | TimeInterval is the delay before the timestamp is updated. | `500 * time.Millisecond` | -| Output | `io.Writer` | Output is a writer where logs are written. | `os.Stdout` | -| DisableColors | `bool` | DisableColors defines if the logs output should be colorized. | `false` | -| enableColors | `bool` | Internal field for enabling colors in the log output. (This is not a user-configurable field) | - | -| enableLatency | `bool` | Internal field for enabling latency measurement in logs. (This is not a user-configurable field) | - | -| timeZoneLocation | `*time.Location` | Internal field for the time zone location. (This is not a user-configurable field) | - | +| Property | Type | Description | Default | +|:-----------------|:---------------------------|:---------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------| +| Next | `func(*fiber.Ctx) bool` | Next defines a function to skip this middleware when returned true. | `nil` | +| Done | `func(*fiber.Ctx, []byte)` | Done is a function that is called after the log string for a request is written to Output, and pass the log string as parameter. | `nil` | +| CustomTags | `map[string]LogFunc` | tagFunctions defines the custom tag action. | `map[string]LogFunc` | +| Format | `string` | Format defines the logging tags. | `${time} \| ${status} \| ${latency} \| ${ip} \| ${method} \| ${path} \| ${error}\n` || TimeFormat | `string` | TimeFormat defines the time format for log timestamps. | `15:04:05` | +| TimeZone | `string` | TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc | `"Local"` | +| TimeInterval | `time.Duration` | TimeInterval is the delay before the timestamp is updated. | `500 * time.Millisecond` | +| Output | `io.Writer` | Output is a writer where logs are written. | `os.Stdout` | +| DisableColors | `bool` | DisableColors defines if the logs output should be colorized. | `false` | +| enableColors | `bool` | Internal field for enabling colors in the log output. (This is not a user-configurable field) | - | +| enableLatency | `bool` | Internal field for enabling latency measurement in logs. (This is not a user-configurable field) | - | +| timeZoneLocation | `*time.Location` | Internal field for the time zone location. (This is not a user-configurable field) | - | ## Default Config ```go diff --git a/docs/guide/routing.md b/docs/guide/routing.md index 2a1067ae6f..dbb92dc65c 100644 --- a/docs/guide/routing.md +++ b/docs/guide/routing.md @@ -150,19 +150,19 @@ Constraints aren't validation for parameters. If constraints aren't valid for a | Constraint | Example | Example matches | | ----------------- | ------------------------------------ | ------------------------------------------------------------------------------------------- | -| int | :id | 123456789, -123456789 | -| bool | :active | true,false | -| guid | :id | CD2C1638-1638-72D5-1638-DEADBEEF1638 | -| float | :weight | 1.234, -1,001.01e8 | -| minLen(value) | :username | Test (must be at least 4 characters) | -| maxLen(value) | :filename | MyFile (must be no more than 8 characters | -| len(length) | :filename | somefile.txt (exactly 12 characters) | -| min(value) | :age | 19 (Integer value must be at least 18) | -| max(value) | :age | 91 (Integer value must be no more than 120) | -| range(min,max) | :age | 91 (Integer value must be at least 18 but no more than 120) | -| alpha | :name | Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive) | -| datetime | :dob | 2005-11-01 | -| regex(expression) | :date | 2022-08-27 (Must match regular expression) | +| int | `:id` | 123456789, -123456789 | +| bool | `:active` | true,false | +| guid | `:id` | CD2C1638-1638-72D5-1638-DEADBEEF1638 | +| float | `:weight` | 1.234, -1,001.01e8 | +| minLen(value) | `:username` | Test (must be at least 4 characters) | +| maxLen(value) | `:filename` | MyFile (must be no more than 8 characters | +| len(length) | `:filename` | somefile.txt (exactly 12 characters) | +| min(value) | `:age` | 19 (Integer value must be at least 18) | +| max(value) | `:age` | 91 (Integer value must be no more than 120) | +| range(min,max) | `:age` | 91 (Integer value must be at least 18 but no more than 120) | +| alpha | `:name` | Rick (String must consist of one or more alphabetical characters, a-z and case-insensitive) | +| datetime | `:dob` | 2005-11-01 | +| regex(expression) | `:date` | 2022-08-27 (Must match regular expression) | **Examples**