mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-29 03:59:58 +00:00
TUN-528: Move cloudflared into a separate repo
This commit is contained in:
41
vendor/github.com/getsentry/raven-go/docs/integrations/http.rst
generated
vendored
Normal file
41
vendor/github.com/getsentry/raven-go/docs/integrations/http.rst
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
net/http
|
||||
========
|
||||
|
||||
Raven Go provides middleware that can be used with the stdlib ``net/http`` library to
|
||||
automatically handle panics that occur during an http request.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Simply install ``raven-go`` through ``go get``::
|
||||
|
||||
$ go get github.com/getsentry/raven-go
|
||||
|
||||
Setup
|
||||
-----
|
||||
|
||||
Make sure that you've set configured ``raven`` with your DSN, typically inside the ``init()``
|
||||
in your ``main`` package is a good place.
|
||||
|
||||
.. sourcecode:: go
|
||||
|
||||
package main
|
||||
|
||||
import "github.com/getsentry/raven-go"
|
||||
|
||||
func init() {
|
||||
raven.SetDSN("___DSN___")
|
||||
}
|
||||
|
||||
If you don't call ``SetDSN``, we will attempt to read it from your environment under the
|
||||
``SENTRY_DSN`` environment variable. The release and environment will also be read from
|
||||
the environment variables ``SENTRY_RELEASE`` and ``SENTRY_ENVIRONMENT`` if set.
|
||||
|
||||
Next, we need to wrap our ``http.Handler`` with our ``RecoveryHandler``:
|
||||
|
||||
.. sourcecode:: go
|
||||
|
||||
func root(w http.ResponseWriter, r *http.Request) {
|
||||
// ... do stuff
|
||||
}
|
||||
http.HandleFunc("/", raven.RecoveryHandler(root))
|
10
vendor/github.com/getsentry/raven-go/docs/integrations/index.rst
generated
vendored
Normal file
10
vendor/github.com/getsentry/raven-go/docs/integrations/index.rst
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
Integrations
|
||||
============
|
||||
|
||||
The Raven Go package currently comes with an integration for the native ``net/http`` module
|
||||
to make it easy to handle common scenarios. More frameworks will be coming soon.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
http
|
Reference in New Issue
Block a user