Define adapter interfaces and fake implementations
This commit is contained in:
@@ -3,13 +3,20 @@ package notify
|
||||
|
||||
import "context"
|
||||
|
||||
// Sender is a placeholder adapter interface for notifications.
|
||||
// Sender is the adapter boundary for notifications.
|
||||
type Sender interface {
|
||||
Send(ctx context.Context, msg Message) error
|
||||
Send(ctx context.Context, req SendRequest) (SendResult, error)
|
||||
}
|
||||
|
||||
// Message is a placeholder notification payload.
|
||||
type Message struct {
|
||||
Subject string
|
||||
Body string
|
||||
// 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user