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)) }
func randomPhraser(res http.ResponseWriter, req *http.Request) { phrase := response.Phrase{adjectives.OneRandom(), animals.OneRandom()} fmt.Fprintln(res, response.BuildResponse(req, phrase, res)) }
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)) }