Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type WebhookHandler ¶
type WebhookHandler struct { // Embedded http.Handler http.Handler // contains filtered or unexported fields }
WebhookHandler provides a framework for handling GitHub webhooks. It implements http.Handler so that it can be used anywhere http.Handler is expected.
Now what is a WebhookHandler good for. All it does is that it takes an event handler object and it routes incoming webhooks to the right methods, e.g. when an issues_event webhook is received, it passes the request into HandleIssuesEvent method. All available event handling methods can be found in the events package.
In case the event handler does not implement the method for the event type received, WebhookHandler simply returns 202 Accepted and does nothing.
func NewWebhookHandler ¶
func NewWebhookHandler(eventHandler interface{}) *WebhookHandler
Click to show internal directories.
Click to hide internal directories.