2026-05-02 10:37:38 -05:00
|
|
|
// Package notify declares the adapter contract for run notifications.
|
|
|
|
|
package notify
|
|
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
2026-05-02 11:44:15 -05:00
|
|
|
// TODO: implement a real notification backend (email/webhook/etc.).
|
|
|
|
|
|
2026-05-02 11:16:27 -05:00
|
|
|
// Sender is the adapter boundary for notifications.
|
2026-05-02 10:37:38 -05:00
|
|
|
type Sender interface {
|
2026-05-02 11:16:27 -05:00
|
|
|
Send(ctx context.Context, req SendRequest) (SendResult, error)
|
2026-05-02 10:37:38 -05:00
|
|
|
}
|
|
|
|
|
|
2026-05-02 11:16:27 -05:00
|
|
|
// SendRequest describes one notification request.
|
|
|
|
|
type SendRequest struct {
|
|
|
|
|
Subject string
|
|
|
|
|
Body string
|
|
|
|
|
Metadata map[string]string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SendResult describes notification send outcome metadata.
|
|
|
|
|
type SendResult struct {
|
|
|
|
|
ProviderMessageID string
|
|
|
|
|
Metadata map[string]any
|
2026-05-02 10:37:38 -05:00
|
|
|
}
|