Coder Social home page Coder Social logo

we4tech / uampnotif Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 70 KB

A simplified notification dispatching system. Can call any HTTP API with dynamic payload, headers and configurable response status.

License: Apache License 2.0

Dockerfile 1.37% Makefile 2.72% Go 95.91%

uampnotif's Introduction

Welcome to UampNotif Project

[WIP] More details coming [WIP] A simplified notification dispatching system.

UampNotif

Build

make build-mac

Usages

Usage of ./uampnotif:
  -d string
    	(Required) Locate receivers directory
  -n string
    	(Required) Locate notification.yml file 

Terms

WIP: Confusing. Needs more simplification

  • Receiver: A unit of notification recipient
  • Notification: A configuration to glue together all notification receivers.

Example configuration

##
# Default settings for all receivers.
#
default_settings:
  retries: 3
  # Do you prefer uampnotif to call all notifcfg concurrently?
  async: true
  # What do you want us to do in case of a failure to notify one of the
  # downstream systems?
  #
  #   Accepted values:
  #    - ignore: Do nothing
  #    - fatal: Exit with 1 if on_error_receivers is set, notify before exiting.
  #    - no_error_receivers: Mute notifying the on_error_receivers
  #
  on_error: ignore
  # TODO: Future feature
  # Do you prefer to notify a list of notifcfg if error arises?
  on_error_receivers:
    - id: slack
      params:
        callback_url: https://httpbin.org/post

##
# A list of notifcfg to be invoked whenever uampnotif is launched.
#
receivers:
  ##
  # id: Must match with corresponding integration id:
  #
  - id: newrelic
    ##
    # You can use go-template with .Env for all param value.
    #
    params:
      callback_url: https://httpbin.org/post
      api_key: '{{.FindEnv "NEWRELIC_API_KEY"}}'

  - id: rollbar
    params:
      access_token: hello-access-token
      environment: staging
      rollbar_username: hello-rollbar-user
      comment: Exception from Rollbar

  - id: slack
    params:
      callback_url: https://httpbin.org/post

  - id: sox-auditor
    params:
      repo_name: test/repo
      secret: hello-world-secret
    ##
    # Override global settings. You can only add the one you may prefer.
    # Uampnotif merges the settings below with the globally exposed settings.
    #
    settings:
      on_error: fatal

Individual receiver spec

name: Test
id: test
request:
  valid_http_codes:
    - 201
    - 200
  params:
    - name: app_id
      label: App ID
    - name: api_key
      label: API Key
    - name: hostname
      label: Hostname
  method: POST
  url_tmpl: '{{.FindEnv "NOTIF_SERVER_URL"}}/v2/applications/{{.FindParam "app_id"}}/deployments.json'
  headers:
    - name: Content-Type
      value_tmpl: application/json
    - name: X-Api-Key
      value_tmpl: '{{.FindParam "api_key"}}'
  body_tmpl: |
    { "deployment": { "revision": "{{.FindEnv "COMMIT_HASH"}}" } }

uampnotif's People

Stargazers

 avatar

Watchers

 avatar  avatar

uampnotif's Issues

Generate auto release tag

Acceptance criteria

  • Should generate a release tag based on VERSION file
  • Should publish binary for Mac
  • Should publish binary Linux

Fix issue with dispatcher

Acceptance criteria

  • Should print out all received events before the process exit
  • Should add verbose logging for all event transition

Update README with usages

Acceptance criteria

  • Should explain the example usages
  • Should explain the flags
  • Should explain receiver-spec
  • Should explain notification config

Add CI pipeline

Acceptance criteria

  • Should run test suite
  • Should compile
  • Should run golanglint

Implement dispatcher to act on notifications.yml config.

As a Dispatcher
I want to call all listed *Notifier* based on preferred retrial and parallelism rules
So that the third party notifier can receive the event.

Acceptance criteria

  • Should follow the retrial preference
  • Should follow the notifier precedence
  • Should follow the parallelism preference
  • Should pass the events through the channel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.