novuhq / go-novu

GO SDK for Novu - The open-source notification infrastructure for engineers. 🚀
MIT License
58 stars 44 forks source link

feat-add feeds api #52

Closed jerempy closed 1 year ago

jerempy commented 1 year ago

Issue: https://github.com/novuhq/go-novu/issues/49

Adds the feeds api methods per https://api.novu.co/api#/Feeds/FeedsController_createFeed

Adds unit tests for new methods

I did not not create an interface for the feeds service as I didn't see the other ones, such as on events.go actually being used anywhere, and I didn't see the need for creating one since the interface doesn't need to be passed anywhere as well. I think leaving it out could help with setting a pattern for future contributors for not writing code that is not implemented.

I did the same thing with the JsonResponse type in models.go. So that it doesn't continue to a pattern of multiple structs that are all the same thing.

i embedded the JsonResponse into the Subscriber and Events response types - so they are the same. I did this instead of deleting them to account for backwards compatibility in case there is anyone using this as a package and upgrade -this way their code doesn't break. For this same reason I didn't delete the unused interfaces in other files.

Cliftonz commented 1 year ago

@jerempy Please resolve the conflicts

jerempy commented 1 year ago

Updated and resolved. should be all good to go