1
0
Fork 0
empact/server/api.go

26 lines
534 B
Go
Raw Normal View History

2015-03-05 15:25:26 +00:00
package server
import (
"net/http"
"github.com/localhots/empact/db"
)
2015-03-06 11:18:15 +00:00
func apiOrgsHandler(w http.ResponseWriter, r *http.Request) {
2015-03-07 14:56:02 +00:00
req, _ := parseRequest(w, r)
orgs := db.UserOrgs(req.login)
req.respondWith(orgs)
2015-03-06 10:56:46 +00:00
}
2015-03-06 11:18:15 +00:00
func apiTeamsHandler(w http.ResponseWriter, r *http.Request) {
2015-03-07 14:56:02 +00:00
req, stat := parseRequest(w, r)
teams := db.OrgTeams(stat.org)
req.respondWith(teams)
2015-03-05 15:25:26 +00:00
}
2015-03-06 11:18:15 +00:00
func apiReposHandler(w http.ResponseWriter, r *http.Request) {
2015-03-07 14:56:02 +00:00
req, stat := parseRequest(w, r)
repos := db.OrgRepos(stat.org)
req.respondWith(repos)
2015-03-06 11:18:15 +00:00
}