digest

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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, workerService *worker.Service, cfg *config.Config, logger *zap.SugaredLogger) *Service

NewService creates a new digest service

func (*Service) GetAllActiveUsers

func (s *Service) GetAllActiveUsers(ctx context.Context) ([]relational.User, error)

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

func (s *Service) GetSubscribedUsers(ctx context.Context) ([]relational.User, error)

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

func (*Service) SendGlobalDigest

func (s *Service) SendGlobalDigest(ctx context.Context) error

SendGlobalDigest sends the global digest to all active users (Phase 0)

func (*Service) SetWorkerService added in v0.10.0

func (s *Service) SetWorkerService(workerService *worker.Service)

SetWorkerService sets the worker service reference (used to avoid circular dependency)

Jump to

Keyboard shortcuts

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