blob: 0e7b797d25ac0bb42f386cfaaabc09a5c7877dbe [file] [log] [blame]
khenaidoo59ce9dd2019-11-11 13:05:32 -05001package probing
2
3import (
4 "encoding/json"
5 "net/http"
6 "time"
7)
8
9func NewHandler() http.Handler {
10 return &httpHealth{}
11}
12
13type httpHealth struct {
14}
15
16type Health struct {
17 OK bool
18 Now time.Time
19}
20
21func (h *httpHealth) ServeHTTP(w http.ResponseWriter, r *http.Request) {
22 health := Health{OK: true, Now: time.Now()}
23 e := json.NewEncoder(w)
24 e.Encode(health)
25}