GinRollbar
Middleware to integrate with rollbar error monitoring. It uses rollbar-go SDK that reports errors and logs messages.
Usage
Download and install it:
go get github.com/neiybor/ginrollbar
Import it in your code:
import "github.com/neiybor/ginrollbar"
Example
package main
import (
"log"
"github.com/gin-gonic/gin"
"github.com/neiybor/ginrollbar"
"github.com/rollbar/rollbar-go"
)
func main() {
rollbar.SetToken("MY_TOKEN")
// roll.SetEnvironment("production") // defaults to "development"
r := gin.Default()
r.Use(ginrollbar.Recovery(true, false, ""))
if err := r.Run(":8080"); err != nil {
log.Fatal(err)
}
}