Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create standalone functions for API methods #96

Open
atc0005 opened this issue Apr 1, 2021 · 0 comments
Open

Create standalone functions for API methods #96

atc0005 opened this issue Apr 1, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Apr 1, 2021

As suggested by @nmaupu on GH-93:

I see a possible improvement though: it would be a great idea to have a singleton that one can use directly (other libraries do that as well, see viper for example: https://github.com/spf13/viper/blob/master/viper.go#L63)
So no need to even create a NewClient() if your usage is the default one 👍 Calls could look like the following:

import teams github.com/atc0005/go-teams-notify
[...]
func main() {
  _ := teams.SendWithContext(context.TODO(), webhook, msg)
}

I agree with the reasoning. Having this available would make getting started with the library even easier.

@atc0005 atc0005 added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 1, 2021
@atc0005 atc0005 added this to the Future milestone Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant