sospartan / shoutrrr

Notification package for go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shoutrrr

Notification library for gophers and their furry friends. Heavily inspired by caronc/apprise.

codacy coverage circleci codacy grade GitHub code size in bytes license GoDoc

Using Shoutrrr

As a package

Using shoutrrr is easy! There is currently two ways of using it as a package.

Using the direct send command
  url := "slack://token-a/token-b/token-c"
  err := shoutrrr.Send(url, "Hello world (or slack channel) !")
Using a sender
  url := "slack://token-a/token-b/token-c"
  sender := shoutrrr.CreateSender(url)
  sender.Send("Hello world (or slack channel) !", map[string]string { /* ... */ })

Through the CLI

Start by running the build.sh script. You may then run the shoutrrr executable:

$ ./shoutrrr

Usage:
./shoutrrr <ActionVerb> [...]
Possible actions: send, verify, generate
Action details
$ ./shoutrrr send
Usage:
./shoutrrr send [OPTIONS] <URL> <Message [...]>

OPTIONS:
  -verbose
        display additional output
$ ./shoutrrr verify
Usage:
./shoutrrr send [OPTIONS] <URL> <Message [...]>
$ ./shoutrrr generate
Usage:
./shoutrrr generate [OPTIONS] <service>

Service URL:s

To make it easy and streamlined to consume shoutrrr regardless of the notification service you want to use, we've implemented a notification service url schema. To send notifications, instantiate the ShoutrrrrClient using one of the service urls below.

Service Format
Discord discord://channel/token
Pushover pushover://token/user/device
Slack slack://token-a/token-b/token-c
slack://botname/token-a/token-b/token-c
Teams teams://token-a/token-b/token-c
Telegram telegram://api-token/channel
telegram://api-token/channel-a/channel-b/channel-c/...
Gotify gotify://gotify-host/token
Pushbullet pushbullet://api-token
pushbullet://api-token/device/#channel/e@mail.com

About

Notification package for go

License:MIT License


Languages

Language:Go 100.0%Language:Shell 0.0%