Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBasicHandlerFunc ¶
func NewBasicHandlerFunc(h health.IHealth) http.HandlerFunc
NewBasicHandlerFunc will return an `http.HandlerFunc` that will write `ok` string + `http.StatusOK` to `rw“ if `h.Failed()` returns `false`; returns `error` + `http.StatusInternalServerError` if `h.Failed()` returns `true`.
func NewJSONHandlerFunc ¶
func NewJSONHandlerFunc(h health.IHealth, custom map[string]interface{}) http.HandlerFunc
NewJSONHandlerFunc will return an `http.HandlerFunc` that will marshal and write the contents of `h.StateMapInterface()` to `rw` and set status code to
`http.StatusOK` if `h.Failed()` is `false` OR set status code to
`http.StatusInternalServerError` if `h.Failed` is `true`. It also accepts a set of optional custom fields to be added to the final JSON body
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.