@@ -39,7 +39,6 @@ import (
39
39
type EventClientConfig struct {
40
40
DestinationURL string `env:"EVENT_URL" envDefault:"http://localhost:3000/notify" description:"Notifier service url"`
41
41
NotificationMedium NotificationMedium `env:"NOTIFICATION_MEDIUM" envDefault:"rest" description:"notification medium"`
42
- EnableNotifierV2 bool `env:"ENABLE_NOTIFIER_V2" envDefault:"false" description:"enable notifier v2"`
43
42
}
44
43
type NotificationMedium string
45
44
@@ -243,7 +242,7 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
243
242
impl .logger .Debugw ("event before send" , "event" , event )
244
243
245
244
// Step 1: Create payload and destination URL based on config
246
- bodyBytes , destinationUrl , err := impl .createPayloadAndDestination (event )
245
+ bodyBytes , destinationUrl , err := impl .createV2PayloadAndDestination (event )
247
246
if err != nil {
248
247
return false , err
249
248
}
@@ -252,13 +251,6 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
252
251
return impl .deliverEvent (bodyBytes , destinationUrl )
253
252
}
254
253
255
- func (impl * EventRESTClientImpl ) createPayloadAndDestination (event Event ) ([]byte , string , error ) {
256
- if impl .config .EnableNotifierV2 {
257
- return impl .createV2PayloadAndDestination (event )
258
- }
259
- return impl .createDefaultPayloadAndDestination (event )
260
- }
261
-
262
254
func (impl * EventRESTClientImpl ) createV2PayloadAndDestination (event Event ) ([]byte , string , error ) {
263
255
destinationUrl := impl .config .DestinationURL + "/v2"
264
256
@@ -302,15 +294,6 @@ func (impl *EventRESTClientImpl) createV2PayloadAndDestination(event Event) ([]b
302
294
return bodyBytes , destinationUrl , nil
303
295
}
304
296
305
- func (impl * EventRESTClientImpl ) createDefaultPayloadAndDestination (event Event ) ([]byte , string , error ) {
306
- bodyBytes , err := json .Marshal (event )
307
- if err != nil {
308
- impl .logger .Errorw ("error while marshaling event request" , "err" , err )
309
- return nil , "" , err
310
- }
311
- return bodyBytes , impl .config .DestinationURL , nil
312
- }
313
-
314
297
func (impl * EventRESTClientImpl ) processNotificationSettings (notificationSettings []repository.NotificationSettings ) ([]* repository.NotificationSettingsBean , error ) {
315
298
notificationSettingsBean := make ([]* repository.NotificationSettingsBean , 0 )
316
299
for _ , item := range notificationSettings {
0 commit comments