From f172c1db854a3f250b26fdbb4d41f2e4fb5af5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20K=C3=B6ser?= Date: Mon, 25 Jan 2021 05:05:59 +0100 Subject: [PATCH] docs: add readme, coc, and contrib guidelines --- CODE_OF_CONDUCT.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 28 +++++++++++++++++ README.md | 74 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 README.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..d1abc70 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,77 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to make participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all project spaces, and it also applies when +an individual is representing the project or its community in public spaces. +Examples of representing a project or community include using an official +project e-mail address, posting via an official social media account, or acting +as an appointed representative at an online or offline event. Representation of +a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at . All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..43016c3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# Contributing to notify +We want to make contributing to this project as easy and transparent as +possible. + +# Project structure + +- `service` - Contains definitions for the underlying notification services. + - `service/discord` - Discord notification service. + - `service/mail` - Email notification service. + - `service/pseudo` - Pseudo notification service used internally to simulate a working service. + - `service/telegram` - Telegram notification service + +## Pull Requests +We actively welcome your pull requests. + +1. Fork the repo and create your branch from `main`. +2. If you've added code that should be tested, add tests. +3. If you've changed APIs, update the documentation. +4. Ensure the test suite passes. +5. Make sure your code lints. + +## Issues +We use GitHub issues to track public bugs. Please ensure your description is +clear and has sufficient instructions to be able to reproduce the issue. + +## License +By contributing to notify, you agree that your contributions will be licensed +under the LICENSE file in the root directory of this source tree. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1d0ff38 --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +

Welcome to notify 👋

+

+ + GitHub release (latest SemVer) + + + Lines of code + + + License: MIT + +

+ +> A dead simple Go library for sending notifications to various messaging platforms. + +## Install + +```sh +go get -u github.com/nikoksr/notify +``` + +## Example usage + +```go +// The notifier we're gonna send our messages to +notifier := notify.New() + +// Create a telegram service. Ignoring error for demo simplicity +telegramService, _ := telegram.New("your_telegram_api_token") + +// Passing a telegram chat id as receiver for our messages. +// Basically where should our message be sent to? +telegramService.AddReceivers(-0123456789) + +// Tell our notifier to use the telegram service. You can repeat the above process +// for as many services as you like and just tell the notifier to use them. +// Its kinda like using middlewares for api servers. +notifier.UseService(telegramService) + +// Send a test message +notifier.Send( + "Message Subject/Title", + "The actual message. Hello, you awesome gophers! :)", +) +``` + +## Roadmap + +* [ ] Add tests +* [ ] Add more notification services + +## Libraries in use + +* [github.com/bwmarrin/discordgo](github.com/bwmarrin/discordgo) +* [github.com/jordan-wright/email](github.com/jordan-wright/email) +* [github.com/go-telegram-bot-api/telegram-bot-api](github.com/go-telegram-bot-api/telegram-bot-api) + +## Author + +👤 **Niko Köser** + +* Twitter: [@nikoksr](https://twitter.com/nikoksr) +* Github: [@nikoksr](https://github.com/nikoksr) + +## 🤝 Contributing + +Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/nikoksr/notify/issues). You can also take a look at the [contributing guide](https://github.com/nikoksr/notify/blob/main/CONTRIBUTING.md). + +## Show your support + +Give a ⭐️ if this project helped you! + +*** +_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_