github.com/wanliu/go-oauth2-server@v0.0.0-20180817021415-f928fa1580df/health/routes.go (about) 1 package health 2 3 import ( 4 "github.com/gorilla/mux" 5 "github.com/wanliu/go-oauth2-server/util/routes" 6 ) 7 8 // RegisterRoutes registers route handlers for the health service 9 func (s *Service) RegisterRoutes(router *mux.Router, prefix string) { 10 subRouter := router.PathPrefix(prefix).Subrouter() 11 routes.AddRoutes(s.GetRoutes(), subRouter) 12 } 13 14 // GetRoutes returns []routes.Route slice for the health service 15 func (s *Service) GetRoutes() []routes.Route { 16 return []routes.Route{ 17 { 18 Name: "health_check", 19 Method: "GET", 20 Pattern: "/health", 21 HandlerFunc: s.healthcheck, 22 }, 23 } 24 }