Files
galaxy-game/lobby/internal/ports/intentpublisher.go
T
2026-04-28 20:39:18 +02:00

25 lines
1003 B
Go

package ports
import (
"context"
"galaxy/notificationintent"
)
//go:generate go run go.uber.org/mock/mockgen -destination=../adapters/mocks/mock_intentpublisher.go -package=mocks galaxy/lobby/internal/ports IntentPublisher
// IntentPublisher is the lobby-facing producer port for normalized
// notification intents. The production adapter is a
// *notificationintent.Publisher which already satisfies this interface;
// service tests use a generated gomock that records every Publish call.
//
// A failed Publish call is a notification degradation per
// lobby/README.md §Notification Contracts and must not roll back already
// committed business state. Callers log the error and proceed.
type IntentPublisher interface {
// Publish normalizes intent and appends it to the configured Redis
// Stream, returning the stream entry id on success. Validation
// failures and transport errors are returned verbatim.
Publish(ctx context.Context, intent notificationintent.Intent) (string, error)
}