Documentation
¶
Overview ¶
Package notify provides desktop notification functionality for match events. Currently supports macOS, Linux, and Windows via the beeep library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DesktopNotifier ¶
type DesktopNotifier struct {
// contains filtered or unexported fields
}
DesktopNotifier implements Notifier using native desktop notifications.
func NewDesktopNotifier ¶
func NewDesktopNotifier() *DesktopNotifier
NewDesktopNotifier creates a new desktop notifier. Notifications are enabled by default.
func (*DesktopNotifier) Enabled ¶
func (n *DesktopNotifier) Enabled() bool
Enabled returns whether notifications are currently enabled.
func (*DesktopNotifier) Goal ¶
func (n *DesktopNotifier) Goal(event api.MatchEvent, homeTeam, awayTeam api.Team, homeScore, awayScore int) error
Goal sends a desktop notification for a new goal event. Includes scorer name, minute, team, and current score. Always plays a terminal beep as a fallback notification.
func (*DesktopNotifier) SetEnabled ¶
func (n *DesktopNotifier) SetEnabled(enabled bool)
SetEnabled enables or disables notifications.
type Notifier ¶
type Notifier interface {
// Goal sends a notification for a new goal event.
Goal(event api.MatchEvent, homeTeam, awayTeam api.Team, homeScore, awayScore int) error
}
Notifier defines the interface for sending desktop notifications. This allows for easy mocking in tests and potential future implementations.