webhookd/pkg/api/routes.go
2019-12-20 10:06:09 +00:00

39 lines
555 B
Go

package api
import (
"net/http"
"github.com/ncarlier/webhookd/pkg/config"
)
// HandlerFunc custom function handler
type HandlerFunc func(conf *config.Config) http.Handler
// Route is the structure of an HTTP route definition
type Route struct {
Methods []string
Path string
HandlerFunc HandlerFunc
}
// Routes is a list of Route
type Routes []Route
var routes = Routes{
Route{
[]string{"GET", "POST"},
"/",
index,
},
Route{
[]string{"GET"},
"/healthz",
healthz,
},
Route{
[]string{"GET"},
"/varz",
varz,
},
}