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)) }
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 }
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 }
// 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 }
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 }
// 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 }
// 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 }
func Example() { r := hookshot.NewRouter() r.HandleFunc("ping", HandlePing) http.ListenAndServe(":8080", r) }