Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryEventBus ¶
type InMemoryEventBus struct {
// contains filtered or unexported fields
}
InMemoryEventBus is a simple in-memory event dispatcher Implements the EventPublisher port
func NewInMemoryEventBus ¶
func NewInMemoryEventBus() *InMemoryEventBus
NewInMemoryEventBus creates a new event bus
func (*InMemoryEventBus) Publish ¶
func (bus *InMemoryEventBus) Publish(event pullrequest.Event) error
Publish dispatches an event to all registered handlers for that event type Implements the EventPublisher port interface
func (*InMemoryEventBus) Subscribe ¶
func (bus *InMemoryEventBus) Subscribe(eventType string, handler port.EventHandler)
Subscribe registers an event handler for a specific event type eventType should be the concrete type name (e.g., "NewPullRequestDetected")
type NotificationAggregator ¶
type NotificationAggregator struct {
// contains filtered or unexported fields
}
NotificationAggregator batches notifications and groups them by PR
func NewNotificationAggregator ¶
func NewNotificationAggregator(flushInterval time.Duration, onFlush func(notifications []*port.PRNotificationData), authenticatedUser string, ignoreConfig *pullrequest.IgnoreConfig) *NotificationAggregator
NewNotificationAggregator creates a new notification aggregator. authenticatedUser is the GitHub login of the current user; activities authored by this user are filtered out (they are domain facts, but not worth notifying about). ignoreConfig may be nil if no ignore.yaml exists yet.
func (*NotificationAggregator) AddEvent ¶
func (a *NotificationAggregator) AddEvent(event pullrequest.Event)
AddEvent adds an event to the aggregator. It is a thin concurrency wrapper around the pure accumulateEvent fold function.
func (*NotificationAggregator) Flush ¶
func (a *NotificationAggregator) Flush()
Flush sends all pending notifications and clears the buffer
func (*NotificationAggregator) Stop ¶
func (a *NotificationAggregator) Stop()
Stop stops the aggregator and flushes any pending notifications
func (*NotificationAggregator) UpdateIgnoreConfig ¶
func (a *NotificationAggregator) UpdateIgnoreConfig(cfg *pullrequest.IgnoreConfig)
UpdateIgnoreConfig atomically replaces the active ignore config. Safe to call from any goroutine.
type NotificationEventHandler ¶
type NotificationEventHandler struct {
// contains filtered or unexported fields
}
NotificationEventHandler handles domain events by sending notifications Implements the EventHandler port
func NewNotificationEventHandler ¶
func NewNotificationEventHandler(notificationPort port.NotificationPort, authenticatedUser string) *NotificationEventHandler
NewNotificationEventHandler creates a new notification event handler. authenticatedUser is the GitHub login of the current user; activities authored by this user are filtered out at the notification level (the domain records all facts, but we only notify about others' activity).
func (*NotificationEventHandler) Flush ¶
func (h *NotificationEventHandler) Flush()
Flush immediately flushes any pending notifications without stopping the handler
func (*NotificationEventHandler) Handle ¶
func (h *NotificationEventHandler) Handle(ctx context.Context, event pullrequest.Event) error
Handle processes domain events and adds them to the aggregator
func (*NotificationEventHandler) Stop ¶
func (h *NotificationEventHandler) Stop()
Stop stops the handler and flushes any pending notifications
func (*NotificationEventHandler) UpdateIgnoreConfig ¶
func (h *NotificationEventHandler) UpdateIgnoreConfig(cfg *pullrequest.IgnoreConfig)
UpdateIgnoreConfig replaces the active ignore config used to filter events. Safe to call from any goroutine.
type TrackingEventHandler ¶
type TrackingEventHandler struct {
// contains filtered or unexported fields
}
TrackingEventHandler handles domain events by updating tracking state Implements the EventHandler port
func NewTrackingEventHandler ¶
func NewTrackingEventHandler(prTrackingRepo pullrequest.PRTrackingRepository) *TrackingEventHandler
NewTrackingEventHandler creates a new tracking event handler
func (*TrackingEventHandler) Handle ¶
func (h *TrackingEventHandler) Handle(ctx context.Context, event pullrequest.Event) error
Handle processes domain events and updates tracking state accordingly