Documentation
¶
Overview ¶
Package errors provides the domain service for error group management, resolution lifecycle, and impact analysis. The repository interfaces define what the service needs from data stores.
Index ¶
- type DetailResult
- type GroupSummary
- type ImpactRepository
- type ImpactResult
- type ListParams
- type ListResult
- type Repository
- type Service
- func (s *Service) Detail(ctx context.Context, fingerprint string) (*DetailResult, error)
- func (s *Service) Ignore(ctx context.Context, fingerprint, reason string) error
- func (s *Service) Impact(ctx context.Context, fingerprint string, userLimit int) (*ImpactResult, error)
- func (s *Service) List(ctx context.Context, p ListParams) (*ListResult, error)
- func (s *Service) Resolve(ctx context.Context, fingerprint, reason string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DetailResult ¶
type DetailResult struct {
Group store.ErrorGroup `json:"group"`
Events []store.ErrorGroupEvent `json:"events"`
}
DetailResult holds the full error group with lifecycle events.
type GroupSummary ¶
type GroupSummary struct {
Fingerprint string `json:"fingerprint"`
Service string `json:"service"`
Environment string `json:"environment,omitempty"`
ExceptionClass string `json:"exception_class,omitempty"`
Message string `json:"message"`
Status string `json:"status"`
OccurrenceCount int `json:"occurrence_count"`
LastSeenAt string `json:"last_seen_at"`
FirstSeenAt string `json:"first_seen_at"`
ReopenedCount int `json:"reopened_count,omitempty"`
}
GroupSummary is a compact view of an error group.
type ImpactRepository ¶
type ImpactRepository interface {
GetImpact(ctx context.Context, fingerprint string) (*store.ErrorImpact, error)
GetAffectedUsers(ctx context.Context, fingerprint string, limit int) ([]store.AffectedUser, error)
GetUserErrors(ctx context.Context, userID string, since time.Time) ([]store.ErrorSummary, error)
}
ImpactRepository defines data access for error impact analysis. Implemented by internal/db.ErrorImpactStore (SQLite adapter).
type ImpactResult ¶
type ImpactResult struct {
Impact *store.ErrorImpact `json:"impact"`
AffectedUsers []store.AffectedUser `json:"affected_users,omitempty"`
}
ImpactResult holds the impact analysis for an error group.
type ListParams ¶
ListParams controls filtering and pagination for error group listing.
type ListResult ¶
type ListResult struct {
TotalUnresolved int `json:"total_unresolved"`
Returned int `json:"returned"`
ErrorGroups []GroupSummary `json:"error_groups"`
}
ListResult is the result of listing error groups.
type Repository ¶
type Repository interface {
List(ctx context.Context, params store.ListErrorGroupParams) ([]store.ErrorGroup, error)
Get(ctx context.Context, fingerprint string) (*store.ErrorGroup, error)
Count(ctx context.Context, status store.ErrorGroupStatus) (int, error)
Resolve(ctx context.Context, fingerprint string, reason string) error
Ignore(ctx context.Context, fingerprint string, reason string) error
ListEvents(ctx context.Context, fingerprint string, limit int) ([]store.ErrorGroupEvent, error)
}
Repository defines data access for error group operations. Implemented by internal/db.ErrorGroupStore (SQLite adapter).
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides error group queries, resolution lifecycle, and impact analysis.
func NewService ¶
func NewService(repo Repository, impact ImpactRepository) *Service
NewService creates an error service. Either dependency may be nil; methods that need them return domain.ErrNotConfigured.
func (*Service) Impact ¶
func (s *Service) Impact(ctx context.Context, fingerprint string, userLimit int) (*ImpactResult, error)
Impact returns impact analysis for an error group, including affected users.
func (*Service) List ¶
func (s *Service) List(ctx context.Context, p ListParams) (*ListResult, error)
List returns error groups matching the given params.