gho
github.com/konboi/ghooks
go get github.com/konboi/ghooks
gho

github.com/konboi/ghooks

github hooks receiver written by golang

by Ryosuke Yabuki

v0.0.0-20170601025816-92ac1e3f843f (see all)License:MIT
go get github.com/konboi/ghooks
Readme

ghooks

ghooks is github hooks receiver. inspired by GitHub::Hooks::Receiver, octoks

Install

go get github.com/Konboi/ghooks

Usage

// sample.go
package main

import (
    "fmt"
    "log"

    "github.com/Konboi/ghooks"
)


func main() {
    port := 8080
    hooks := ghooks.NewServer(port)

    hooks.On("push", pushHandler)
    hooks.On("pull_request", pullRequestHandler)
    hooks.Run()
}

func pushHandler(payload interface{}) {
    fmt.Println("puuuuush")
}

func pullRequestHandler(payload interface{}) {
    fmt.Println("pull_request")
}
go run sample.go
curl -H "X-GitHub-Event: push" -d '{"hoge":"fuga"}' http://localhost:8080
> puuuuush

GitHub Stars

12

LAST COMMIT

5yrs ago

MAINTAINERS

0

CONTRIBUTORS

5

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
v0.0.0-20170601025816-92ac1e3f843f
2yrs ago
v0.0.0-20160510081807-cc2f6b5502c1
2yrs ago
No alternatives found
No tutorials found
Add a tutorial