push

command module
v0.0.0-...-5710dc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 5 Imported by: 0

README

GoDoc Liberapay

This program will send push notifications via Google FCM and/or (in the same time) Apple notification services and provide you easy to use REST API and/or (in the same time) redis queue.

Example request:

curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"title":"test", "token":"lJo3Kr4X9s1:APA91bEKvZJRuaiZZMmiRArOGx454yePPHaoLQtqqBI3tiXNA_Evu7uBFqMXbn7xZBfR2r4SDQEOj514vmd4L3Nxe_U_Sw9MdOfe1cOkU-sfn2QPlKzSaEzAinihlzqSCai9_n_lS2oE","body":"newbody", "priority": "high", "sound": "sound.mp3", "transport": "fcm", "data_only": false}' \
    http://localhost

Features

Listens on

  • Redis
  • HTTP

on the same time. If one of listeners is broken, the second one will work.

Sends to

  • FCM
  • APNS

on the same time

Configuration

This tool needs a config.json file with this minimal structure

{
    "http": {
        "enabled": true,
        "port": 8080,
        "endpoint": "/"
    },
    "fcm": {
        "token": "FCM Server token ('new' server key)"
    }
}

You can also specify the config file path with the -config flag. For example:

push -config my/custom/dir/my_config.json

Check more configuration options in the conf.json.dist

Run

Golang

go get gitlab.com/rakshazi/push
cd $GOPATH/src/gitlab.com/rakshazi/push
go install
curl https://gitlab.com/rakshazi/push/raw/master/config.json.dist -o config.json
push

Binary

# Get binary from project -> releases page

curl https://gitlab.com/rakshazi/push/raw/master/config.json.dist -o config.json
push

Docker

curl https://gitlab.com/rakshazi/push/raw/master/config.json.dist -o config.json
docker run -d -v "$PWD/config.json:/etc/config.json" -p 80:8080 registry.gitlab.com/rakshazi/push

curl http://localhost

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL