Split Web into API/Dashboard, ping, metric and Rest Provider

This commit is contained in:
SALLEYRON Julien 2017-11-09 16:12:04 +01:00 committed by Traefiker
parent 384488ac02
commit 27d1b46835
24 changed files with 1252 additions and 377 deletions

21
ping/ping.go Normal file
View file

@ -0,0 +1,21 @@
package ping
import (
"fmt"
"net/http"
"github.com/containous/mux"
)
//Handler expose ping routes
type Handler struct {
EntryPoint string `description:"Ping entryPoint" export:"true"`
}
// AddRoutes add ping routes on a router
func (g Handler) AddRoutes(router *mux.Router) {
router.Methods("GET", "HEAD").Path("/ping").
HandlerFunc(func(response http.ResponseWriter, request *http.Request) {
fmt.Fprint(response, "OK")
})
}