Example #1
0
func main() {
	r := hookshot.NewRouter()
	r.HandleFunc("ping", ping)
	r.HandleFunc("deployment", deployment)
	r.NotFoundHandler = http.HandlerFunc(ping)

	log.Fatal(http.ListenAndServe(":"+os.Getenv("PORT"), r))
}
Example #2
0
func New(tug *tugboat.Tugboat, secret string) http.Handler {
	r := hookshot.NewRouter()

	r.Handle("ping", http.HandlerFunc(Ping))
	r.Handle("deployment", hookshot.Authorize(&DeploymentHandler{tugboat: tug}, secret))

	return r
}
Example #3
0
func New(e *empire.Empire, opts Options) httpx.Handler {
	r := hookshot.NewRouter()

	secret := opts.Secret
	r.Handle("deployment", hookshot.Authorize(&DeploymentHandler{Deployer: opts.Deployer, environments: opts.Environments}, secret))
	r.Handle("ping", hookshot.Authorize(http.HandlerFunc(Ping), secret))

	return r
}
Example #4
0
// NewServer returns a new Server instance
func NewServer(q BuildQueue) *Server {
	s := &Server{Queue: q}

	r := hookshot.NewRouter()
	r.HandleFunc("ping", s.Ping)
	r.HandleFunc("push", s.Push)

	s.mux = r
	return s
}
Example #5
0
func newServer(c client) *Server {
	s := &Server{
		client: c,
	}

	g := hookshot.NewRouter()
	g.HandleFunc("ping", s.Ping)
	g.HandleFunc("push", s.Push)

	s.mux = g
	return s
}
Example #6
0
// NewServer returns a new Server instance
func NewServer(c *Conveyor) *Server {
	s := &Server{Conveyor: c}

	r := hookshot.NewRouter()
	r.HandleFunc("ping", s.Ping)
	r.HandleFunc("push", s.Push)

	n := negroni.Classic()
	n.UseHandler(r)

	s.mux = n
	return s
}
Example #7
0
// NewServer returns a new Server instance
func NewServer(q BuildQueue) *Server {
	s := &Server{Queue: q}

	r := hookshot.NewRouter()
	r.HandleFunc("ping", s.Ping)
	r.HandleFunc("push", s.Push)

	n := negroni.Classic()
	n.UseHandler(r)

	s.mux = n
	return s
}
Example #8
0
func Example() {
	r := hookshot.NewRouter()
	r.HandleFunc("ping", HandlePing)

	http.ListenAndServe(":8080", r)
}