Documentation
¶
Overview ¶
Package goaraygun provides a couple of middlewares for https://goa.design/ to send failures to https://raygun.com/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Recover ¶
func Recover() goa.Middleware
Recover is a middleware that recovers panics and maps them to errors. Use this instead of the goa one to have cleaner errors without the stacktrace in their main message.
Types ¶
type Manager ¶ added in v1.1.0
Manager exposes a Notify middleware and and an Error function. Use the Notify middleware in the goa middleware chain, and the Error method to send an error to
func (*Manager) Error ¶ added in v1.1.0
func (m *Manager) Error(ctx context.Context, err error, req *http.Request, tags []string, data interface{})
Error sends a custom error to raygun. You can provide a request, tags and custom data if you want
func (*Manager) Middleware ¶ added in v1.1.0
func (m *Manager) Middleware() goa.Middleware
Middleware is a middleware that sends critical errors to Raygun. It should sit between ErrorHandler and Recover in the middleware chain. Key is the raygun api key, opts can be nil or can be an Opts struct
type Opts ¶
type Opts struct { // Version is an optional value to provide the version of the app you are monitoring Version string // Silent is an optional value to avoid sending errors but just to print them in the stdout. Useful for debugging Silent bool // Skip is an optional function to decide if the error is worth sending to raygun or not. // If it's not defined, only panics and status codes of 500 are sent. Skip func(ctx context.Context, err error) bool // GetUser is an optional function to retrieve the username from the context and/or the request GetUser func(ctx context.Context, req *http.Request) string }
Opts contain the configuration of the Notify middleware