orbiter/api/router.go
Gianluca Arbezzano 1709cf5150 Event stream
2017-02-24 00:16:28 +00:00

16 lines
440 B
Go

package api
import (
"github.com/Sirupsen/logrus"
"github.com/gianarb/orbiter/core"
"github.com/gorilla/mux"
)
func GetRouter(core core.Core, eventChannel chan *logrus.Entry) *mux.Router {
r := mux.NewRouter()
r.HandleFunc("/handle/{autoscaler_name}/{service_name}", Handle(core.Autoscalers)).Methods("POST")
r.HandleFunc("/health", Health()).Methods("GET")
r.HandleFunc("/events", Events(eventChannel)).Methods("GET")
return r
}