@@ -68,6 +68,25 @@ type topicEventJSON struct {
68
68
PubsubName string `json:"pubsubname"`
69
69
}
70
70
71
+ type status string
72
+
73
+ const (
74
+ // SubscriptionResponseStatusSuccess indicates that the subscription event was processed successfully.
75
+ SubscriptionResponseStatusSuccess status = "SUCCESS"
76
+ )
77
+
78
+ type BulkSubscribeResponseEntry struct {
79
+ // The id of the bulk subscribe entry
80
+ entryId string
81
+
82
+ // The response status of the bulk subscribe entry
83
+ status status
84
+ }
85
+
86
+ type BulkSubscribeResponse struct {
87
+ statuses []BulkSubscribeResponseEntry
88
+ }
89
+
71
90
func (s * Server ) registerBaseHandler () {
72
91
// register subscribe handler
73
92
f := func (w http.ResponseWriter , r * http.Request ) {
@@ -397,7 +416,7 @@ func (s *Server) AddBulkTopicEventHandler(sub *common.Subscription, fn common.Bu
397
416
return
398
417
}
399
418
400
- entriesInterface , ok := ins ["entries" ].([]interface {})
419
+ entriesInterface , ok := ins ["entries" ].([]interface {})
401
420
if ! ok {
402
421
// Handle the error or return an error response
403
422
http .Error (w , "Entries format error" , PubSubHandlerDropStatusCode )
@@ -411,8 +430,7 @@ func (s *Server) AddBulkTopicEventHandler(sub *common.Subscription, fn common.Bu
411
430
http .Error (w , "Entry format error" , PubSubHandlerDropStatusCode )
412
431
return
413
432
}
414
-
415
- itemJSON , err := json .Marshal (itemMap )
433
+ itemJSON , err := json .Marshal (itemMap ["event" ])
416
434
if err != nil {
417
435
http .Error (w , err .Error (), PubSubHandlerDropStatusCode )
418
436
return
@@ -423,7 +441,6 @@ func (s *Server) AddBulkTopicEventHandler(sub *common.Subscription, fn common.Bu
423
441
http .Error (w , err .Error (), PubSubHandlerDropStatusCode )
424
442
return
425
443
}
426
-
427
444
data , rawData := item .getData ()
428
445
429
446
if item .PubsubName == "" {
0 commit comments