Documentation
¶
Overview ¶
Package dailyreport provides functionality for generating and sending daily PR reports to users.
Index ¶
Constants ¶
View Source
const ( // MinHoursBetweenReports is the minimum time between daily reports (23 hours). MinHoursBetweenReports = 23 // WindowStartHour is when the daily report window opens (6am local time). WindowStartHour = 6 // WindowEndHour is when the daily report window closes (11:30am local time). // We use hour 11 and check minutes separately to support 11:30am cutoff. WindowEndHour = 12 // Exclusive, so 11:59am is the last valid time )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender handles sending daily reports to users.
func NewSender ¶
func NewSender(stateStore StateStore, slackClient SlackClient) *Sender
NewSender creates a new daily report sender.
func (*Sender) SendReport ¶
func (s *Sender) SendReport(ctx context.Context, userInfo UserBlockingInfo) error
SendReport sends a daily report to a user.
func (*Sender) ShouldSendReport ¶
func (s *Sender) ShouldSendReport(ctx context.Context, userInfo UserBlockingInfo) bool
ShouldSendReport determines if a report should be sent to a user now.
type SlackClient ¶
type SlackClient interface {
SendDirectMessageWithBlocks(ctx context.Context, userID string, blocks []slack.Block) (dmChannelID, messageTS string, err error)
UserTimezone(ctx context.Context, userID string) (string, error)
IsUserActive(ctx context.Context, userID string) bool
}
SlackClient handles Slack API operations.
Click to show internal directories.
Click to hide internal directories.