Documentation ¶
Index ¶
Constants ¶
View Source
const (
TraceStackDepth = 128
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Capturer ¶
type Capturer interface { // WithNewTrace causes any captures to automatically get a stack trace // associated to them. WithNewTrace() Capturer // WithAppPackages causes the listed packages (and any child packages) to be // highlighted as part of the current application in stack traces. WithAppPackages(packages []string) Capturer // WithUser adds the given user information to any errors reported. WithUser(u User) Capturer // WithTags adds the given tags to any errors reported. WithTags(tags ...Tag) Capturer // Try runs the given function, and if a panic occurs, captures and reports // it. It returns the recovered value of the panic, or nil if no panic // occurred. // // The context received by the callback will have this capturer bound to it. Try(ctx context.Context, fn func(ctx context.Context)) interface{} // Capture captures the given error for reporting. Capture(err error) Reporter // CaptureMessage converts the given message to an error and captures it. CaptureMessage(message string) Reporter // Middleware returns an HTTP middleware configured for this capturer. Middleware() Middleware }
func MustCapturerFromContext ¶
type Middleware ¶
type Middleware interface { WithTags(tags ...Tag) Middleware WithUser(u User) Middleware Wrap(target http.Handler) http.Handler }
type Reporter ¶
type Reporter interface { // WithNewTrace adds a stack trace at the error location to the report. WithNewTrace() Reporter // WithTrace adds the given stack trace to the report. WithTrace(t *Trace) Reporter // WithTags adds the given tags to this error report. WithTags(tags ...Tag) Reporter // AsWarning reduces the severity of this error to a warning. AsWarning() Reporter // Report submits this error to the reporting service asynchronously. Report(ctx context.Context) <-chan error // ReportSync submits this error to the reporting service and waits for a // response. ReportSync(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.