go-github-protobuf

module
v0.0.0-...-904c460 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT

README

Go Bindings for Github API protobuf

This project contains the Go bindings for the protobuf definition files for entities and events in the Github API. This bindings generated from the jhaynie/github-protobuf project.

Install

import "github.com/jhaynie/go-github-protobuf/github"

Usage

Parse an incoming Github WebHook event and convert to the appropriate event class:

// r is the http request
payload, err := github.ValidatePayload(r, "your secret")
if err != nil {
	// error
}
event, err := github.ParseWebHook(github.WebHookType(r), payload)
if err != nil {
	// handle error
}
switch event := event.(type) {
	case CommitCommentEvent:
	    processCommitCommentEvent(event)
	case CreateEvent:
	    processCreateEvent(event)
}

License

Licensed under the MIT License.

Directories

Path Synopsis
Package github is a generated protocol buffer package.
Package github is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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