Skip to content

Commit

Permalink
update const naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Mulatua committed Jan 6, 2020
1 parent a45e2ed commit 9461a97
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions media.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
)

const (
// BigPicture :nodoc:
BigPicture = "big_picture"
// LargeIcon :nodoc:
LargeIcon = "large_icon"
// IOSAttachment :nodoc:
IOSAttachment = "ios_attahcment"
// _BigPicture :nodoc:
_BigPicture = "big_picture"
// _LargeIcon :nodoc:
_LargeIcon = "large_icon"
// _IOSAttachment :nodoc:
_IOSAttachment = "ios_attahcment"
)

// GeneratePushNotificationMediaURL Generates manipulated media URL for push notification purpose
Expand All @@ -26,13 +26,13 @@ func GeneratePushNotificationMediaURL(cdnURL, mediaSrcURL, imageType string) str
var param string
switch imageType {

case LargeIcon:
case _LargeIcon:
param = "image/upload/fl_progressive,fl_lossy,c_fill,g_face,q_auto:best,w_256,ar_1:1"

case BigPicture:
case _BigPicture:
param = "image/upload/fl_progressive,fl_lossy,c_fill,g_face,q_auto:best,w_1440,h_720"

case IOSAttachment:
case _IOSAttachment:
param = "image/upload/fl_progressive,fl_lossy,c_fill,g_face,q_auto:best,w_1024,h_1024"
}

Expand Down
2 changes: 1 addition & 1 deletion media_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import (

func Test_GeneratePushNotificationMediaURL(t *testing.T) {
externalMediaURL := "https://this.is/test/image/upload/123/234.jpg"
res := GeneratePushNotificationMediaURL("https://this.is", externalMediaURL, LargeIcon)
res := GeneratePushNotificationMediaURL("https://this.is", externalMediaURL, _LargeIcon)
assert.Equal(t, "https://this.is/image/upload/fl_progressive,fl_lossy,c_fill,g_face,q_auto:best,w_256,ar_1:1/123/234.jpg", res)
}

0 comments on commit 9461a97

Please sign in to comment.