handlers

package
Version: v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 3 Imported by: 0

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

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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