major refactoring of the api

This commit is contained in:
didier amyot committed 2015-03-28 20:53:28 -07:00
1 parent d4f7dc57fc
commit f0628e4682
38 files changed
+821 -367

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package api
import (
"fmt"
"net/http"
)
func GetAllDoormen(w http.ResponseWriter, request *http.Request) {
fmt.Fprint(w, `{"doormen" :[`)
doormenIds := conn.GetAllDoormen()
buff := <-doormenIds
if buff == nil {
fmt.Fprint(w, "]}")
return
}
for doormanId := range doormenIds {
fmt.Fprint(w, getDoormenIdsAsJson(buff)+`,`)
buff = doormanId
}
fmt.Fprint(w, getDoormenIdsAsJson(buff), "]}")
}