Skip to content

Commit 7d87b1b

Browse files
authored
Renamed WebpushFcmOptions to WebpushFCMOptions (#334)
1 parent aa4e7a4 commit 7d87b1b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

messaging/messaging.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ type WebpushConfig struct {
554554
Headers map[string]string `json:"headers,omitempty"`
555555
Data map[string]string `json:"data,omitempty"`
556556
Notification *WebpushNotification `json:"notification,omitempty"`
557-
FcmOptions *WebpushFcmOptions `json:"fcm_options,omitempty"`
557+
FCMOptions *WebpushFCMOptions `json:"fcm_options,omitempty"`
558558
}
559559

560560
// WebpushNotificationAction represents an action that can be performed upon receiving a WebPush notification.
@@ -660,8 +660,8 @@ func (n *WebpushNotification) UnmarshalJSON(b []byte) error {
660660
return nil
661661
}
662662

663-
// WebpushFcmOptions contains additional options for features provided by the FCM web SDK.
664-
type WebpushFcmOptions struct {
663+
// WebpushFCMOptions contains additional options for features provided by the FCM web SDK.
664+
type WebpushFCMOptions struct {
665665
Link string `json:"link,omitempty"`
666666
}
667667

messaging/messaging_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ var validMessages = []struct {
311311
Vibrate: []int{100, 200, 100},
312312
CustomData: map[string]interface{}{"k1": "v1", "k2": "v2"},
313313
},
314-
FcmOptions: &WebpushFcmOptions{
314+
FCMOptions: &WebpushFCMOptions{
315315
Link: "https://link.com",
316316
},
317317
},
@@ -959,7 +959,7 @@ var invalidMessages = []struct {
959959
req: &Message{
960960
Webpush: &WebpushConfig{
961961
Notification: &WebpushNotification{},
962-
FcmOptions: &WebpushFcmOptions{
962+
FCMOptions: &WebpushFCMOptions{
963963
Link: "link",
964964
},
965965
},
@@ -972,7 +972,7 @@ var invalidMessages = []struct {
972972
req: &Message{
973973
Webpush: &WebpushConfig{
974974
Notification: &WebpushNotification{},
975-
FcmOptions: &WebpushFcmOptions{
975+
FCMOptions: &WebpushFCMOptions{
976976
Link: "http://link.com",
977977
},
978978
},

messaging/messaging_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ func validateWebpushConfig(webpush *WebpushConfig) error {
222222
return fmt.Errorf("multiple specifications for the key %q", k)
223223
}
224224
}
225-
if webpush.FcmOptions != nil {
226-
link := webpush.FcmOptions.Link
225+
if webpush.FCMOptions != nil {
226+
link := webpush.FCMOptions.Link
227227
p, err := url.ParseRequestURI(link)
228228
if err != nil {
229229
return fmt.Errorf("invalid link URL: %q", link)

0 commit comments

Comments
 (0)