Minimal go library to relay webhook events back to an arbitrary service.

hookrelay

Minimal go library to relay webhook events back to an arbitrary service. With the use of a primary HTTP mux router, we are able to register endpoints (e.g., /hook) with a corresponding Response function to handle the aggregation of incoming requests.

First, there is a Hook interface we must satisfy by implementing it's functions for later usage.

type Hook interface {
	Response(i interface{}) func(w http.ResponseWriter, r *http.Request)
	LoadConfig(config string) error
	Endpoint() string
	Options() byte
}
  • Response: Contains the incoming webhook event request data and defines
    how to handle it.
  • LoadConfig: Used for any special configuration that may be used by
    the hook.
  • Endpoint: The endpoint path that events should be sent to.
  • Options: Optional middleware a hook may find useful, such as limiting
    the endpoint to only accept POST methods.

Examples can be found in the examples directory for practical usage and a better understanding. There is not a great deal behind this, and was more of a thin-wrapper to use in smaller sized, adhoc projects.

License

BSD 2-Clause

Similar Resources

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

Dec 13, 2021

Implement a REST API to drive a UI for service management

An implementation an API of the specification the drive a UI for engaging with services of an organization.

Nov 3, 2021

This service finds and โ€” if necessary โ€” generates icons for web sites

This service finds and โ€” if necessary โ€” generates icons for web sites

favicon-service (besticon) This is a favicon service: Supports favicon.ico and apple-touch-icon.png Simple URL API Fallback icon generation Docker ima

Nov 2, 2021

longurl is a self-hosted short url service.

longurl Introduction longurl is a self-hosted short url service. Try It Out curl -H "Content-Type:application/json" -X POST --data '{"url": "https://g

Oct 24, 2022

Users API Service

Users API Service

bookstore_users-api Users API Service Overview This application handles users. Project Structure This project was written in golang, designed to use M

Feb 12, 2022

An inventory service for managing farming vehicles, equipment, and resources

An inventory service for managing farming vehicles, equipment, and resources

Inventory ๐Ÿ“ฆ An inventory service for managing farming vehicles, equipment, and resources. What is this? A REST API for managing farm inventory via HT

Apr 29, 2022

A service which updates the WAF IP blocklist

autowaf A service which updates the WAF IP blocklist Development Project is currently in development phase. Build Build and run locally go build -o au

Nov 8, 2021

Build a TodoList with Go Design and implement a backend RESTful service in golang with CRUD

May we ask Igor to do a little project in leu of sample code? If there is a hire, the hours spent should be invoiced, so please keep track of that. Th

May 5, 2022

Ml-mate service helper trainer record experiment, dataset and performance

ml-mate service helper trainer record experiment, dataset and performance trainmate-sdk(ml-mate-py) trainmate-fe(ml-mate-frontend) trainmate-server(ml

Nov 23, 2021
Project E-Commerce Alta Store Program Immersive Back End Batch 4
Project E-Commerce Alta Store Program Immersive Back End Batch 4

Project E-Commerce Project E-Commerce Alta Store Program Immersive Back End Batch 4 Explore the docs ยป Daftar Isi About The Project Built With ERD Con

Dec 30, 2021
This is a cert-manager webhook solver for DNSPod.

cert-manager-webhook-dnspod This is a cert-manager webhook solver for DNSPod. Prerequisites cert-manager >= 1.6.0 Installation Generate SecretId and S

Jan 6, 2023
A self-hosted golang application that listens for Terraform pull request events via webhooks.
A self-hosted golang application that listens for Terraform pull request events via webhooks.

Atlantis Terraform Pull Request Automation Resources What is Atlantis? What does it do? Why should you use it? Stargazers over time Resources How to g

Dec 9, 2021
A minimal honeypot written in Golang.
A minimal honeypot written in Golang.

bucket - A minimal honeypot written in Golang. A honeypot written in Golang that enumerates connected clients, logs activity, and more! Features Featu

Dec 2, 2021
Minimal bundling for projects that require generation (e.g. SASS to CSS)

staticgen staticgen is a tool that generates file bundles and watches directories for changes. Configuration Project configurations are specified in t

Dec 14, 2021
A simple file-based service to stand in for the remote-service proxy on Apigee.

Apigee-Remote-Service-File A simple file-based service to stand in for the remote-service proxy on Apigee. All configuration is done locally in a YAML

Nov 3, 2021
A webpage bookmarking and snapshotting service

Omnom A webpage bookmarking and snapshotting service. Omnom is a rebooted implementation of @stef's original omnom project, big thanks for it.

Nov 22, 2022
GoatCounter is an open source web analytics platform available as a hosted service or self-hosted app

GoatCounter is an open source web analytics platform available as a hosted service (free for non-commercial use) or self-hosted app. It aims to offer easy to use and meaningful privacy-friendly web analytics as an alternative to Google Analytics or Matomo.

Dec 29, 2022
Example patterns for distributed service

Cloud Native Tulisan ini akan mengulas hasil pembelajaran dari beberapa sumber #learn-from-books. Dan terinspirasi dari obrolan The Pursuit of Product

Jan 30, 2022
Birthdays is a web service that stores the birthday date of users and calculates the remaining days until the user's birthday.
Birthdays is a web service that stores the birthday date of users and calculates the remaining days until the user's birthday.

Birthdays is a web service that stores the birthday date of users and calculates the remaining days until the user's birthday. Features Metrics servic

May 2, 2022