Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func C2FHandler ¶
func C2FHandler(c float64) http.HandlerFunc
C2FHandler is converting degrees celsius to degrees fahrenheit Status OK (200) is returned with the body containing celsius/fahrenheit pair. NotAcceptable (406) if path parameter can't be parsed to a float64 FailedDependency (424) is returned if client returned an error Status InternalServerError (500) is returned in case of general errors.
func F2CHandler ¶
func F2CHandler(f float64) http.HandlerFunc
F2CHandler is converting degrees fahrenheit to degrees celsius Status OK (200) is returned with the body containing celsius/fahrenheit pair. NotAcceptable (406) if path parameter can't be parsed to a float64 FailedDependency (424) is returned if client returned an error Status InternalServerError (500) is returned in case of general errors.
func Float64InputValidator ¶
func Float64InputValidator(route string, f func(float64) http.HandlerFunc) http.HandlerFunc
Float64InputValidator validates float64 input, passing control to f if input is ok
func HealthHandler ¶
func HealthHandler(w http.ResponseWriter, r *http.Request)
HealthHandler displays health status of the service. Status OK (200) is returned if service's client can be used, else status FailedDependency (424) is returned. Status InternalServerError (500) is returned in case of general errors.
Types ¶
type DegreePair ¶
type DegreePair struct { C float64 `json:"celsius" example:"100"` F float64 `json:"fahrenheit" example:"212"` }
DegreePair contains celsius/fahrenheit pair