@@ -13,20 +13,20 @@ import (
1313 "github.com/palantir/stacktrace"
1414)
1515
16- // NotificationListener handles cloud events which sends notifications
17- type NotificationListener struct {
16+ // PhoneNotificationListener handles cloud events which sends notifications
17+ type PhoneNotificationListener struct {
1818 logger telemetry.Logger
1919 tracer telemetry.Tracer
20- service * services.NotificationService
20+ service * services.PhoneNotificationService
2121}
2222
23- // NewNotificationListener creates a new instance of NotificationListener
23+ // NewNotificationListener creates a new instance of PhoneNotificationListener
2424func NewNotificationListener (
2525 logger telemetry.Logger ,
2626 tracer telemetry.Tracer ,
27- service * services.NotificationService ,
28- ) (l * NotificationListener , routes map [string ]events.EventListener ) {
29- l = & NotificationListener {
27+ service * services.PhoneNotificationService ,
28+ ) (l * PhoneNotificationListener , routes map [string ]events.EventListener ) {
29+ l = & PhoneNotificationListener {
3030 logger : logger .WithService (fmt .Sprintf ("%T" , l )),
3131 tracer : tracer ,
3232 service : service ,
@@ -39,7 +39,7 @@ func NewNotificationListener(
3939}
4040
4141// onMessageAPISent handles the events.EventTypeMessageAPISent event
42- func (listener * NotificationListener ) onMessageAPISent (ctx context.Context , event cloudevents.Event ) error {
42+ func (listener * PhoneNotificationListener ) onMessageAPISent (ctx context.Context , event cloudevents.Event ) error {
4343 ctx , span := listener .tracer .Start (ctx )
4444 defer span .End ()
4545
@@ -49,7 +49,7 @@ func (listener *NotificationListener) onMessageAPISent(ctx context.Context, even
4949 return listener .tracer .WrapErrorSpan (span , stacktrace .Propagate (err , msg ))
5050 }
5151
52- sendParams := & services.NotificationScheduleParams {
52+ sendParams := & services.PhoneNotificationScheduleParams {
5353 UserID : payload .UserID ,
5454 Owner : payload .Owner ,
5555 Source : event .Source (),
@@ -65,7 +65,7 @@ func (listener *NotificationListener) onMessageAPISent(ctx context.Context, even
6565}
6666
6767// onMessageNotificationScheduled handles the events.EventTypeMessageNotificationScheduled event
68- func (listener * NotificationListener ) onMessageNotificationScheduled (ctx context.Context , event cloudevents.Event ) error {
68+ func (listener * PhoneNotificationListener ) onMessageNotificationScheduled (ctx context.Context , event cloudevents.Event ) error {
6969 ctx , span := listener .tracer .Start (ctx )
7070 defer span .End ()
7171
@@ -75,7 +75,7 @@ func (listener *NotificationListener) onMessageNotificationScheduled(ctx context
7575 return listener .tracer .WrapErrorSpan (span , stacktrace .Propagate (err , msg ))
7676 }
7777
78- scheduleParams := & services.NotificationSendParams {
78+ scheduleParams := & services.PhoneNotificationSendParams {
7979 UserID : payload .UserID ,
8080 PhoneID : payload .PhoneID ,
8181 Source : event .Source (),
0 commit comments