1
0
mirror of https://github.com/nikoksr/notify.git synced 2025-11-06 09:09:09 +02:00

docs: add readme, coc, and contrib guidelines

This commit is contained in:
Niko Köser
2021-01-25 05:05:59 +01:00
parent b9c0efe21f
commit f172c1db85
3 changed files with 179 additions and 0 deletions

77
CODE_OF_CONDUCT.md Normal file
View File

@@ -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 <opensource-conduct@fb.com>. 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

28
CONTRIBUTING.md Normal file
View File

@@ -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.

74
README.md Normal file
View File

@@ -0,0 +1,74 @@
<h1 align="center">Welcome to notify 👋</h1>
<p>
<a href="#" target="_blank">
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/nikoksr/notify">
</a>
<a href="#" target="_blank">
<img alt="Lines of code" src="https://img.shields.io/tokei/lines/github/nikoksr/notify">
</a>
<a href="#" target="_blank">
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
</a>
</p>
> 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!<br />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)_