webhook-adapter

command module
v0.0.0-...-39ad147 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

CDEvents Webhook Adapter

A CDEvents Webhook Adapter can receive events via Webhooks and translate them into CDEvents, with the help of various translators which supports publishing events via Webhooks. The translated CDEvents can be sent to configured messageBroker URL

This adapter provides client and server implementation over an RPC connection and exposes an interface for plugin implementation,

// EventTranslator is the interface that we're exposing as a plugin.
type EventTranslator interface {
	TranslateEvent(event string, headers http.Header) (string, error)
}

Various translators can be developed as plugins by implementing this interface method and serve using Hashicorp's go-plugin

Translator's configuration

Once the plugin implemented translator-plugins.yaml needs an update with the details of Plugin name, pluginURL and messageBroker

translator:
  path: "./plugins"
  plugins:
    - name: "<pluginName>"
      pluginURL: "<plugin's binary URL>"
      messageBroker: "<message broker URL>"

DOWNLOAD_PLUGIN is an environment variable that can be set to true or false to download the plugin's binary from the translator's pluginURL when launching this adapter. Alternatively, the plugin's binary can also be downloaded manually and placed under the ./plugins directory (create it if it does not exist).

Plugins implemented using this adapter

Plugin Name Plugin Repo
gerrit-translator-cdevents https://github.com/cdevents/gerrit-translator
jira-translator-cdevents https://github.com/cdevents/jira-translator

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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