webhookx

command module
v0.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

WebhookX Go Report Card Build Status Build Status

Join Slack Follow on Twitter

WebhookX is an open-source webhooks gateway for message receiving, processing, and delivering.

Features

  • Admin API: The admin API(:8080) provides a RESTful API for webhooks entities management.
  • Retries: WebhookX automatically retries unsuccessful deliveries at configurable delays.
  • Fan out: Events can be fan out to multiple destinations.
  • Declarative configuration: Managing your configuration through declarative configuration file, and be DevOps compliant.

Roadmap

  • Workspace
  • Data retention policy
  • OpenAPI
  • Insight admin APIs
  • Observability(o11y) including tracing and metrics
  • Declarative configuration management
Outbound
  • Authentication
  • Manually retry
Inbound
  • Inbound Gateway
  • Middlewares/Plugins
  • Authentication
  • Event Transformer

Installation

$ docker build . -t webhookx-io/webhookx:latest
$ docker compose up
$ curl http://localhost:8080

Getting started

1. Create an endpoint
$ curl -X POST http://localhost:8080/workspaces/default/endpoints \
  --header 'Content-Type: application/json' \
  --data '{
      "request": {
          "url": "https://httpbin.org/anything",
          "method": "POST"
      },
      "events": [
          "charge.succeeded"
      ]
  }'
2. Create a source
$ curl -X POST http://localhost:8080/workspaces/default/sources \
  --header 'accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "path": "/",
    "methods": ["POST"]
  }'
3. Send an event to proxy
$ curl -X POST http://localhost:8081 \
--header 'Content-Type: application/json' \
--data '{
    "event_type": "charge.succeeded",
    "data": {
        "key": "value"
    }
}'
4. Retrieve delivery attemp
$ curl http://localhost:8080/workspaces/default/attempts

{
  "total": 1,
  "data": [
    {
      "id": "2l6HMc9FSJHsGqf8ouLdqTGx1GB",
      "event_id": "2l6HMYvsWlK35Kz5RzIi1KV1jvl",
      "endpoint_id": "2l6HLC2usWDFOj7H4e8dIgEaJO5",
      "status": "SUCCESSFUL",
      "attempt_number": 1,
      "attempt_at": 1724493558,
      "request": {
        "method": "POST",
        "url": "https://httpbin.org/anything",
        "header": {},
        "body": "{\"key\": \"value\"}"
      },
      "response": {
        "status": 200,
        "header": {},
        "body": "{\n  \"args\": {}, \n  \"data\": \"{\\\"key\\\": \\\"value\\\"}\", \n  \"files\": {}, \n  \"form\": {}, \n  \"headers\": {\n    \"Accept-Encoding\": \"gzip\", \n    \"Content-Length\": \"16\", \n    \"Content-Type\": \"application/json; charset=utf-8\", \n    \"Host\": \"httpbin.org\", \n    \"User-Agent\": \"WebhookX/dev\", \n    \"X-Amzn-Trace-Id\": \"Root=1-66c9aef9-214447eb1bcaad151f29744e\"\n  }, \n  \"json\": {\n    \"key\": \"value\"\n  }, \n  \"method\": \"POST\", \n  \"origin\": \"13.114.230.241\", \n  \"url\": \"https://httpbin.org/anything\"\n}\n"
      },
      "created_at": 1724493559,
      "updated_at": 1724493559
    }
  ]
}

Runtime dependencies

The gateway requires the following runtime dependencies to work:

  • PostgreSQL(>=13)
  • Redis(>=4)

Sponsoring

Contributing

We ❤️ pull requests

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