presenter

package
v0.0.0-...-0abc3cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 6 Imported by: 0

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

type ErrStruct

type ErrStruct struct {
	Msg string `json:"errorMessage" example:"A horrible, terrible, absolutely awful error"`
}

ErrStruct contains errorMessage

type Health

type Health struct {
	Status string `json:"status" example:"UP"`
}

Health contains status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL