Skip to content

derekpitt/githubservicehook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Github Web Service hook server in Go

Crazy simple little server here.

package main

import (
  "github.com/derekpitt/githubservicehook"
  "log"
  "time"
)

func main() {
  processor := githubservicehook.New(func(p githubservicehook.Payload) {
    log.Println("starting: ", p.Repository.Name)
    time.Sleep(1 * time.Second)
    log.Println("done...")
  })

  log.Fatal(processor.Start(":8080"))
}

install

go install github.com/derekpitt/githubservicehook

A little more detail

  • Holds an internal queue so it will process requests in the order recieved while keeping githubs hook processor happy. (runs your handler in a go routine and returns as fast as possible to github)

  • Each processor is contained, so you can run multiple servers in one process (each in a go routine, since Start() will block)

TODO:

  • Write some tests

About

Github Web Service hook server in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages