Documentation
¶
Index ¶
- type EvidenceItem
- type EvidenceSummary
- type GlobalDigestJob
- type Service
- func (s *Service) GetAllActiveUsers(ctx context.Context) ([]relational.User, error)
- func (s *Service) GetGlobalEvidenceSummary(ctx context.Context) (*EvidenceSummary, error)
- func (s *Service) GetSubscribedUsers(ctx context.Context) ([]relational.User, error)
- func (s *Service) SendDigestEmail(ctx context.Context, user *relational.User, summary *EvidenceSummary) error
- func (s *Service) SendGlobalDigest(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvidenceItem ¶
type EvidenceItem struct {
ID string
UUID string
Title string
Description string
Status string
ExpiresAt string // Formatted expiration date string (empty if no expiration)
Labels []string
}
EvidenceItem represents a single evidence entry for display
type EvidenceSummary ¶
type EvidenceSummary struct {
TotalCount int64
SatisfiedCount int64
NotSatisfiedCount int64
ExpiredCount int64
OtherCount int64
// Top items for the digest email
TopExpired []EvidenceItem
TopNotSatisfied []EvidenceItem
}
EvidenceSummary contains aggregated evidence statistics
type GlobalDigestJob ¶
type GlobalDigestJob struct {
// contains filtered or unexported fields
}
GlobalDigestJob is a scheduled job that sends global evidence digests
func NewGlobalDigestJob ¶
func NewGlobalDigestJob(service *Service, logger *zap.SugaredLogger) *GlobalDigestJob
NewGlobalDigestJob creates a new global digest job
func (*GlobalDigestJob) Execute ¶
func (j *GlobalDigestJob) Execute(ctx context.Context) error
Execute runs the digest job
func (*GlobalDigestJob) Name ¶
func (j *GlobalDigestJob) Name() string
Name returns the unique name of the job
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles digest generation and delivery
func NewService ¶
func NewService(db *gorm.DB, emailService *email.Service, cfg *config.Config, logger *zap.SugaredLogger) *Service
NewService creates a new digest service
func (*Service) GetAllActiveUsers ¶
GetAllActiveUsers returns all active users (for admin purposes)
func (*Service) GetGlobalEvidenceSummary ¶
func (s *Service) GetGlobalEvidenceSummary(ctx context.Context) (*EvidenceSummary, error)
GetGlobalEvidenceSummary retrieves evidence summary across all evidence (Phase 0)
func (*Service) GetSubscribedUsers ¶
GetSubscribedUsers returns all active users who are subscribed to digest emails
func (*Service) SendDigestEmail ¶
func (s *Service) SendDigestEmail(ctx context.Context, user *relational.User, summary *EvidenceSummary) error
SendDigestEmail sends a digest email to a user