INNER CODE UNIT · Go

GetTags

cryptag/cryptag · servers/cryptag-webserver/main.go:372

func GetTags(w http.ResponseWriter, req *http.Request) {
	_ = req.ParseForm()

	// TODO(elimisteve): Should use filesytem.TagPairsFromRandomTags
	// to find all TagPairs with those random tags.
	allTagPairs, err := filesystem.AllTagPairs(nil)
	if err != nil {
		help.WriteError(w, "Error getting TagPairs: "+err.Error(),
			http.StatusInternalServerError)
		return
	}

	randtags := req.Form["tags"]
	if len(randtags) == 0 {
		if types.Debug {
			log.Printf("All %d TagPairs retrieved", len(allTagPairs))
		}
		help.WriteJSON(w, allTagPairs)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…