Categorygithub.com/neiybor/ginrollbar
modulepackage
0.0.4
Repository: https://github.com/neiybor/ginrollbar.git
Documentation: pkg.go.dev

# README

GinRollbar

Run Tests codecov Go Report Card GoDoc Join the chat at https://gitter.im/gin-gonic/gin

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)
  }
}

# Packages

No description provided by the author

# Functions

Recovery middleware for rollbar error monitoring.