Giter Site home page Giter Site logo

aereal / go-problem-reporter Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 36 KB

go-problem-reporter captures HTTP responses that conform to RFC7807 Problem Details from your web application and sends to error reporting services.

License: MIT License

Go 100.00%
problemdetails go golang-library go-http-middleware

go-problem-reporter's Introduction

status PkgGoDev

go-problem-reporter

go-problem-reporter captures HTTP responses that conform to RFC7807 Problem Details from your web application and sends to error reporting services.

Currently supported services:

Synopsis

package main

import (
  "github.com/getsentry/sentry-go"
  "github.com/moogar0880/problems"
  sentryhttp "github.com/getsentry/sentry-go/http"
  sentryreporter "github.com/aereal/go-problem-reporter/sentry"
)

func main() {
  h := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
    p := problems.NewDetailedProblem(http.StatusInternalServerError, "some details"),
    problems.StatusProblemHandler(p).ServeHTTP(rw, r)
  })
  mw := sentryreporter.New(sentryreporter.Options{WaitForDelivery: true})
  withSentryHub := sentryhttp.New(sentryhttp.Options{}).Handle
  &http.Server{
    Handler: withSentryHub(mw(h)),
  }
}

Installation

go get github.com/aereal/go-problem-reporter

License

See LICENSE file.

go-problem-reporter's People

Contributors

aereal avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

go-problem-reporter's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v2
  • reviewdog/action-golangci-lint v2
  • actions/checkout v2
  • actions/setup-go v2
gomod
go.mod
  • go 1.17
  • github.com/aereal/gomas v0.3.0
  • github.com/getsentry/sentry-go v0.11.0
  • github.com/google/go-cmp v0.5.9
  • github.com/moogar0880/problems v0.1.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.