-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync docs for release https://github.com/gofiber/contrib/releases/tag…
- Loading branch information
1 parent
e73da2d
commit 9eda784
Showing
7 changed files
with
114 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
contrib_versioned_docs/version-fiberi18n_v2.x.x/monitor/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
id: monitor | ||
--- | ||
|
||
# Monitor | ||
|
||
![Release](https://img.shields.io/github/v/tag/gofiber/contrib?filter=monitor*) | ||
![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7) | ||
![Test](https://github.com/gofiber/contrib/workflows/Tests/badge.svg) | ||
![Security](https://github.com/gofiber/contrib/workflows/Security/badge.svg) | ||
![Linter](https://github.com/gofiber/contrib/workflows/Linter/badge.svg) | ||
|
||
Monitor middleware for [Fiber](https://github.com/gofiber/fiber) that reports server metrics, inspired by [express-status-monitor](https://github.com/RafalWilinski/express-status-monitor) | ||
|
||
![](https://i.imgur.com/nHAtBpJ.gif) | ||
|
||
## Install | ||
|
||
This middleware supports Fiber v3. | ||
|
||
``` | ||
go get -u github.com/gofiber/fiber/v3 | ||
go get -u github.com/gofiber/contrib/monitor | ||
``` | ||
|
||
### Signature | ||
|
||
```go | ||
monitor.New(config ...monitor.Config) fiber.Handler | ||
``` | ||
|
||
### Config | ||
|
||
| Property | Type | Description | Default | | ||
| :--------- | :------------------------ | :----------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | | ||
| Title | `string` | Metrics page title. | `Fiber Monitor` | | ||
| Refresh | `time.Duration` | Refresh period. | `3 seconds` | | ||
| APIOnly | `bool` | Whether the service should expose only the montioring API. | `false` | | ||
| Next | `func(c *fiber.Ctx) bool` | Define a function to add custom fields. | `nil` | | ||
| CustomHead | `string` | Custom HTML code to Head Section(Before End). | `empty` | | ||
| FontURL | `string` | FontURL for specilt font resource path or URL. also you can use relative path. | `https://fonts.googleapis.com/css2?family=Roboto:wght@400;900&display=swap` | | ||
| ChartJsURL | `string` | ChartJsURL for specilt chartjs library, path or URL, also you can use relative path. | `https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.bundle.min.js` | | ||
|
||
### Example | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/gofiber/fiber/v3" | ||
"github.com/gofiber/contrib/monitor" | ||
) | ||
|
||
func main() { | ||
app := fiber.New() | ||
|
||
// Initialize default config (Assign the middleware to /metrics) | ||
app.Get("/metrics", monitor.New()) | ||
|
||
// Or extend your config for customization | ||
// Assign the middleware to /metrics | ||
// and change the Title to `MyService Metrics Page` | ||
app.Get("/metrics", monitor.New(monitor.Config{Title: "MyService Metrics Page"})) | ||
|
||
log.Fatal(app.Listen(":3000")) | ||
} | ||
``` | ||
|
||
|
||
## Default Config | ||
|
||
```go | ||
var ConfigDefault = Config{ | ||
Title: defaultTitle, | ||
Refresh: defaultRefresh, | ||
FontURL: defaultFontURL, | ||
ChartJsURL: defaultChartJSURL, | ||
CustomHead: defaultCustomHead, | ||
APIOnly: false, | ||
Next: nil, | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
contrib_versioned_docs/version-fiberi18n_v2.x.x/socketio/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
id: socketio | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
contrib_versioned_sidebars/version-fiberi18n_v2.x.x-sidebars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"tutorialSidebar": [ | ||
"left_sidebar": [ | ||
{ | ||
"type": "autogenerated", | ||
"dirName": "." | ||
|