Esempio n. 1
0
func letterPhraser(res http.ResponseWriter, req *http.Request) {
	vars := mux.Vars(req)
	letter := vars["letter"]
	phrase := response.Phrase{adjectives.OneStartingWith(letter), animals.OneStartingWith(letter)}
	fmt.Fprintln(res, response.BuildResponse(req, phrase, res))
}
Esempio n. 2
0
func randomPhraser(res http.ResponseWriter, req *http.Request) {
	phrase := response.Phrase{adjectives.OneRandom(), animals.OneRandom()}
	fmt.Fprintln(res, response.BuildResponse(req, phrase, res))
}
Esempio n. 3
0
func alliterativePhraser(res http.ResponseWriter, req *http.Request) {
	adj := adjectives.OneRandom()
	phrase := response.Phrase{adj, animals.OneStartingWith(adj[:1])}

	fmt.Fprintln(res, response.BuildResponse(req, phrase, res))
}