feat: user service
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package local
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"galaxy/user/internal/ports"
|
||||
)
|
||||
|
||||
// NoopDeclaredCountryChangedPublisher validates and discards auxiliary
|
||||
// declared-country change events.
|
||||
type NoopDeclaredCountryChangedPublisher struct{}
|
||||
|
||||
// PublishDeclaredCountryChanged validates event and discards it.
|
||||
func (NoopDeclaredCountryChangedPublisher) PublishDeclaredCountryChanged(
|
||||
ctx context.Context,
|
||||
event ports.DeclaredCountryChangedEvent,
|
||||
) error {
|
||||
if ctx == nil {
|
||||
return fmt.Errorf("publish declared-country changed event: nil context")
|
||||
}
|
||||
if err := ctx.Err(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return event.Validate()
|
||||
}
|
||||
|
||||
var _ ports.DeclaredCountryChangedPublisher = NoopDeclaredCountryChangedPublisher{}
|
||||
Reference in New Issue
Block a user