Git Product home page Git Product logo

hukz's Introduction

Hukz

Releasability: Quality Gate Status
Reliability: Reliability Rating Bugs
Security: Security Rating Vulnerabilities
Maintainability: Maintainability Rating Technical Debt Code Smells
Other: Lines of Code Duplicated Lines (%) Coverage

A simple & lightweight service implemented in go to add webhooks in your application. This service is intended to fire webhooks on different events that are registered.

Concepts

  • Event: A simple event string (eg. post.created)
  • Webhook: Webhook registration object. It contains information about events, url (to which webhook will be fired), tags (key value list to filter webhooks)

Usage

  • Need to install nats.io for queuing service.
  • Needs to install postgres database.
  • On publishing event to nats.io server, huks service will subscribe to all events added in db and fire webhooks accordingly.
  • One can add multiple events, the naming convention of events is based on your application usage.
  • Every request takes "X-User" header and to keep track of user who created resources (webhook, event etc.).
  • Whenever a webhook is fired its response, tags, etc are logged in webhook_logs.

Sample Config

DATABASE_HOST=postgres 
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres
DATABASE_NAME=hukz 
DATABASE_PORT=5432 
DATABASE_SSL_MODE=disable

NATS_URL=nats://nats:4222
NATS_USER_NAME=natsuser
NATS_USER_PASSWORD=natspassword
QUEUE_GROUP=dega

MODE=development
  • Config file should be stored in project root folder with name config (ext can be yml, json, env)
  • Environment variables can also be set for configuration parameters with HUKZ_ prefix to above variables.

Example

Create event in tag.created in hukz service and register webhook with tag app:example. Now in the publisher server application can send tag.created event to NATS, whenever a tag is created as follows:

if err = util.NC.Publish("tag.created", result); err != nil {
    log.Fatal(err)
}

Hukz service will handle firing webhooks to the URLs which are registered to tag.created event. Also, you can get logs of all webhooks fired on /webhooks/logs endpoint.

All events, webhooks and logs can be filtered by tags field. Multiple tag query params can be passed with key:value syntax to get entities which has given tags.

hukz's People

Contributors

hetjagani avatar shreeharsha-factly avatar deshetti avatar ganga2166 avatar surajmn1 avatar vsumit89 avatar

Stargazers

Keyth M Citizen  avatar Niranjan Anandkumar avatar  avatar

Watchers

James Cloos avatar Rakesh Dubbudu avatar  avatar

hukz's Issues

add space id to webhooks

currently as we are not associating webhooks with space ids , notifications are being sent out for events in all spaces

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.