1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package health import "net/http" type Controller struct { } func New() *Controller { return &Controller{} } func (c *Controller) MountTo(mux *http.ServeMux) { mux.HandleFunc("GET /health", c.Index) } func (c *Controller) Index(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) }