jas

command module
v0.0.0-...-dfaf0ec Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2014 License: MIT Imports: 5 Imported by: 0

README

Jas

GoDoc

Captain 'Jas' Hook: A Github Hook handler.

Jas can be included in a net/http server to listen on a path for github webhooks.

Basic Setup

Install the Jas package (go 1.1 and greater is required):

go get github.com/wm/jas
package main

import (
	"net/http"

	"github.com/wm/jas/lib"
)

func main() {
	j := jas.NewJas()
	j.RegisterHandlerFunc(jas.PushPayloadLogger)
	j.RegisterHandler(jas.NewFileChangeEmailer(jas.FileChangeEmailerOptions{
		Emails: &[]string{"will@example.com", "eliot@example.com"},
		Files:  &[]string{"db/structure.sql", "db/schema.rb"},
	}))

	mux := http.NewServeMux()
	mux.Handle("/", j)
	http.ListenAndServe(":1234", mux)
}

Then run your server:

go run main.go

You will now have a web server running on port 1234 that can handle incomming Github webhooks. Next you need to add a webhook to a github repo. See the Github Webhook Guide for help.

See main.go for an example server.

Handlers

TODO

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Captain 'Jas' Hook: A Github Hook handler.
Captain 'Jas' Hook: A Github Hook handler.

Jump to

Keyboard shortcuts

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