From 4c9e57ac0ec3f17a38ad730ff1186e83f2222b9a Mon Sep 17 00:00:00 2001 From: Samuel Mulatua Date: Mon, 6 Jan 2020 11:29:56 +0700 Subject: [PATCH] export const --- media.go | 18 +++++++++--------- media_test.go | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/media.go b/media.go index 079e68a..5a4fa8a 100644 --- a/media.go +++ b/media.go @@ -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 @@ -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" } diff --git a/media_test.go b/media_test.go index c9edd51..a0a5841 100644 --- a/media_test.go +++ b/media_test.go @@ -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) }