blob: 0e7b797d25ac0bb42f386cfaaabc09a5c7877dbe [file] [log] [blame]
khenaidooab1f7bd2019-11-14 14:00:27 -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}