go-fcm icon indicating copy to clipboard operation
go-fcm copied to clipboard

Allow callers to inject their own HTTP client.

Open danmarg opened this issue 7 years ago • 5 comments

This is necessary for AppEngine usage, where the standard HTTP client from net/http is not allowed.

danmarg avatar Nov 14 '17 12:11 danmarg

good change. but this will make some changes in the api. so make a setclient func to set other client if needed, else the client will set to the default http

NaySoftware avatar Nov 17 '17 15:11 NaySoftware

Happy to do so, but just to be clear, this is a new "constructor" function (NewFcmClientWithHttp vs NewFcmClient).

A SetClient func is also a reasonable approach. I dunno which is more Gothonic.

On Fri, Nov 17, 2017 at 4:38 PM Ahmad [Abo] Khet [email protected] wrote:

good change. but this will make some changes in the api. so make a setclient func to set other client if needed, else the client will set to the default http

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NaySoftware/go-fcm/pull/15#issuecomment-345277395, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1viwReJgO2S5OZ1mn_1OZvP1VnlfCUks5s3ahwgaJpZM4QdSUt .

danmarg avatar Nov 17 '17 17:11 danmarg

I'll re-review the current commit and will discuss it :) Thank you very much

NaySoftware avatar Nov 17 '17 18:11 NaySoftware

BTW, star the repo :)

NaySoftware avatar Nov 17 '17 18:11 NaySoftware

No worries. I don't mind changing it, either, if you prefer an injector--just wanted to make sure you saw how it works now. Let me know your preference.

On Fri, Nov 17, 2017 at 7:34 PM Ahmad [Abo] Khet [email protected] wrote:

I'll re-review the current commit and will discuss it :) Thank you very much

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NaySoftware/go-fcm/pull/15#issuecomment-345325858, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1vi9OfysKBArylgs_YSgZ9TEWRHuvgks5s3dGngaJpZM4QdSUt .

danmarg avatar Nov 17 '17 19:11 danmarg