Skip to content

shogo82148/ghwebhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghwebhook

USAGE

package main

import (
	"log"
	"net/http"

	"github.com/google/go-github/github"
	"github.com/shogo82148/ghwebhook"
)

func main() {
	h := &ghwebhook.Webhook{
		// recommend to set secret
		Secret:       "very-secret-string",

		// Restrict IP address
		RestrictAddr: true,
		TrustAddrs:   []string{"::1/128", "127.0.0.0/8"},

		Ping: func(e *github.PingEvent) {
			log.Printf("%#v", e)
		},
	}
	http.ListenAndServe(":8080", h)
}

Related Projects

About

github webhook receiver utils written by golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages