25 lines
947 B
Go
25 lines
947 B
Go
package ports
|
|
|
|
import (
|
|
"context"
|
|
|
|
"galaxy/notificationintent"
|
|
)
|
|
|
|
//go:generate go run go.uber.org/mock/mockgen -destination=../adapters/mocks/mock_notificationpublisher.go -package=mocks galaxy/gamemaster/internal/ports NotificationIntentPublisher
|
|
|
|
// NotificationIntentPublisher is the producer port Game Master uses to
|
|
// publish notification intents to Notification Service. The production
|
|
// adapter is a thin wrapper around `notificationintent.Publisher`.
|
|
//
|
|
// A failed Publish call is a notification degradation per
|
|
// `galaxy/gamemaster/README.md §Notification Contracts` and must not
|
|
// roll back already committed runtime state. Callers log the error
|
|
// and proceed.
|
|
type NotificationIntentPublisher interface {
|
|
// Publish normalises intent and appends it to the configured
|
|
// Redis Stream. Validation failures and transport errors are
|
|
// returned verbatim.
|
|
Publish(ctx context.Context, intent notificationintent.Intent) error
|
|
}
|