dialog-push-service

command module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

Dialog push service

Dialog Push Service (DPS) is a tiny service for pushing remote notifications.

DPS consists of two sub-projects:

  • gRPC server that does actual delivery
  • Scala module for Dialog Server which provides Scala bindings to gRPC server

Getting Started

You need to install go, protobuf and gogo-protobuf extensions:

brew install go
brew install protobuf
go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/protoc-gen-gogoslick
go get github.com/gogo/protobuf/gogoproto

You also need to make sure the protoc-gen-gogoslick is in the $PATH.

Config

Legacy FCM HTTP
google:
  - project-id: <string>
    key: <string>
    retries: <number>
    timeout: <string>
    nop-mode: <boolean>
    workers: <number>
    allow-alerts: <boolean>
    sandbox: <boolean>

properties:

  • project-id - identificator of the provider
  • key
  • retries - count retries by server error
  • timeout - time duration. Example: 1s, 2m
  • nop-mode - if the option is set to true, the message will not be sent
  • workers - count workers for sending. By default the value is equal count of processors.
  • allow-alerts - enabled alerting messages for converter protobuf push message to a notification message
  • sandbox - if the option is set to true, the message will not be actually sent. Instead FCM performs all the necessary validations, and emulates the send operation
FCM HTTP v1 (GCM)
fcm:
  - project-id: <string>
    service-account: <string>
    retries: <number>
    timeout: <string>
    nop-mode: <boolean>
    workers: <number>
    allow-alerts: <boolean>
    sandbox: <boolean>

properties:

  • project-id - identificator of the provider
  • service-account
  • retries - count retries by server error
  • timeout - time duration. Example: 1s, 2m
  • nop-mode - if the option is set to true, the message will not be sent
  • workers - count workers for sending. By default the value is equal count of processors.
  • allow-alerts - enabled alerting messages for converter protobuf push message to a notification message
  • sandbox - if the option is set to true, the message will not be actually sent. Instead FCM performs all the necessary validations, and emulates the send operation
APNS
apple:
  - project-id: <string>
    pem: <string>
    retries: <number>
    timeout: <string>
    nop-mode: <boolean>
    workers: <number>
    allow-alerts: <boolean>
    sandbox: <boolean>

properties:

  • project-id - identifier of the provider
  • pem - path to tls certificate in pem format
  • retries - count retries by server error
  • timeout - time duration. Example: 1s, 2m
  • nop-mode - if the option is set to true, the message will not be sent
  • workers - count workers for sending. By default the value is equal count of processors.
  • allow-alerts - enabled alerting messages for converter protobuf push message to a notification message
  • topic - the topic of the remote notification, which is typically the bundle ID for your ap
  • sound - sound of the alerting message

Test environment

  1. download iOS certificate in PEM format
  2. create environment variable APPLE_PUSH_CERTIFICATE with path to PEM
  3. download service-account.json
  4. create environment variable GOOGLE_APPLICATION_CREDENTIALS with path to service-account.json
  5. copy server key
  6. save server key in a file. File format:
{
  "key":"<server key>"
}
  1. create environment variable GOOGLE_LEGACY_APPLICATION_CREDENTIALS with path to server key file
  2. create devices tokens file. File format:
{
  "android": "<token>",
  "ios": "<token>"
}
  1. create environment variable PUSH_DEVICES with path to devices tokens file

Metrics

Metrics split by provider type and project identifier:

  • processed_tasks -quantity of successfully sent push-notifications.
  • failed_tasks - quantity of push-notifications with errors.
  • io - time of sending push-notifications
  • pushes_recv - quantity of push-notifications received from IP of a sender.

Client application

Android

Build and run:

License

This software is available under the Apache 2.0 License

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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