github

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LabeledWith

func LabeledWith(issue *github.Issue, labelName string) bool

func NewClient

func NewClient() (*github.Client, error)

Types

type Config

type Config struct {
	WebhookSecret string `envconfig:"WEBHOOK_SECRET"`
	Token         string `envconfig:"TOKEN"`
}

func GetConfig

func GetConfig() 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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