Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GreetingHandler ¶
func GreetingHandler(w http.ResponseWriter, r *http.Request)
GreetingHandler returns a GreetingResponse which either has errors or a useful payload
func HelloHandler ¶
func HelloHandler(w http.ResponseWriter, r *http.Request)
HelloHandler takes a GET parameter "name" and responds with Hello <name>! in plaintext
Types ¶
type GreetingResponse ¶
type GreetingResponse struct { Payload struct { Greeting string `json:"greeting,omitempty"` Name string `json:"name,omitempty"` Error string `json:"error,omitempty"` } `json:"payload"` Successful bool `json:"successful"` }
GreetingResponse is the JSON Response that GreetingHandler returns
Click to show internal directories.
Click to hide internal directories.