- Fix error return value checks (errcheck) - Fix unused parameters by using underscore prefix - Add missing package comments to all packages - Fix context key type issue in middleware (use typed contextKey) - Replace deprecated trace.NewNoopTracerProvider with noop.NewTracerProvider - Fix embedded field selector in database client - Remove trailing whitespace - Remove revive linter (as requested) to avoid stuttering warnings for public API interfaces All linting and formatting checks now pass.
22 lines
569 B
Go
22 lines
569 B
Go
// Package errorbus provides interfaces for error publishing and handling.
|
|
package errorbus
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// ErrorPublisher defines the interface for publishing errors to the error bus.
|
|
type ErrorPublisher interface {
|
|
// Publish publishes an error to the error bus.
|
|
// The error will be logged and optionally reported to external services.
|
|
Publish(ctx context.Context, err error)
|
|
}
|
|
|
|
// ErrorContext provides additional context for errors.
|
|
type ErrorContext struct {
|
|
RequestID string
|
|
UserID string
|
|
Component string
|
|
Metadata map[string]interface{}
|
|
}
|