pkg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CapturePanic

func CapturePanic()

CapturePanic is a helper function that recovers from a panic and reports it. Use it with defer in your main function or goroutines.

Types

type ErrorEvent

type ErrorEvent struct {
	Message    string            `json:"message"`
	StackTrace string            `json:"stack_trace"`
	Timestamp  time.Time         `json:"timestamp"`
	Labels     map[string]string `json:"labels,omitempty"`
}

ErrorEvent represents a captured error with additional context.

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

Reporter handles error reporting.

func NewReporter

func NewReporter() *Reporter

NewReporter creates a new Reporter using the global configuration.

func (*Reporter) Report

func (r *Reporter) Report(err error, labels map[string]string)

Report captures an error (with full stack trace), attaches labels, logs it to the console, and sends a notification to Slack if configured.

Jump to

Keyboard shortcuts

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