webhooks

package module
v0.0.0-...-30a80b2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

README

go-github-webhook-server

Provides HTTP Handlers and Go Types to Handle Github's Webhooks

Documentation

Index

Constants

View Source
const (
	EventTypePing  = "ping"
	EventTypePush  = "push"
	EventTypeWatch = "watch"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackPushEvent

type CallbackPushEvent func(event *github.PushEvent)

type CallbackWatchEvent

type CallbackWatchEvent func(event *github.WatchEvent)

type GithubWebhookHandler

type GithubWebhookHandler struct {
	// contains filtered or unexported fields
}

provides the http handler and interface for adding callbacks

func NewGithubWebhookHandler

func NewGithubWebhookHandler(secretToken string, out io.Writer) *GithubWebhookHandler

func (*GithubWebhookHandler) AddCallbackForPushEvent

func (h *GithubWebhookHandler) AddCallbackForPushEvent(cb CallbackPushEvent)

add a callback for Push Events

func (*GithubWebhookHandler) AddCallbackForWatchEvent

func (h *GithubWebhookHandler) AddCallbackForWatchEvent(cb CallbackWatchEvent)

add a callback for Watch Events

func (*GithubWebhookHandler) ServeHTTP

func (h *GithubWebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

The main HTTP Handler that handles github webhooks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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