# README
buuurst_dev_go
Golang middleware for Mx.Load
Installation
go get github.com/mxload/buuurst_dev_go
Usage
go-chi
import (
...
buuurst_dev "github.com/mxload/buuurst_dev_go"
)
func main() {
r := chi.NewRouter()
// Add buuurst_dev middleware
r.Use(buuurst_dev.MiddlewareFunc(
// buuurst_dev collector configuration
&buuurst_dev.BuuurstDevConfig{
Enabled: true, // Make collector enable/disable
CollectorURL: "https://lambda-public.buuurst.dev/put-request-log",
ProjectID: YOUR_PROJECT_ID, // Set your project ID
ServiceKey: "YOUR_SERVICE_KEY", // Set your service key
CustomHeaders: []string{ // Set headers that should be sent to buuurst.dev
"Authorization",
},
IgnorePaths: []string{ // Set ignored paths
"/ignored",
},
},
))
....
}
echo
import (
...
buuurst_dev "github.com/mxload/buuurst_dev_go"
)
func main() {
e := echo.New()
e.Use(echo.WrapMiddleware(buuurst_dev.MiddlewareFunc(
&buuurst_dev.BuuurstDevConfig{
Enabled: true,
CollectorURL: "https://lambda-public.buuurst.dev/put-request-log",
ProjectID: YOUR_PROJECT_ID,
ServiceKey: "YOUR_SERVICE_KEY",
CustomHeaders: []string{
"Authorization",
},
IgnorePaths: []string{
"/ignored",
},
},
)))
...
}
gin example
import (
"net/http"
"github.com/gin-gonic/gin"
adapter "github.com/gwatts/gin-adapter"
buuurst_dev "github.com/mxload/buuurst_dev_go"
)
func main() {
r := gin.Default()
r.Use(adapter.Wrap(buuurst_dev.MiddlewareFunc(
&buuurst_dev.BuuurstDevConfig{
Enabled: true,
CollectorURL: "https://lambda-public.buuurst.dev/put-request-log",
ProjectID: YOUR_PROJECT_ID,
ServiceKey: "YOUR_SERVICE_KEY",
CustomHeaders: []string{
"Authorization",
},
IgnorePaths: []string{
"/ignored",
},
},
)))
...
}
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author