1
0
Fork 0
empact/db/org.go

21 lines
418 B
Go

package db
import (
"time"
)
type Org struct {
Login string `json:"login"`
Descr string `json:"descr"`
ID uint64 `json:"id"`
AvatarURL string `json:"avatar_url"`
}
const userOrgsQuery = `select o.* from members m join orgs o on o.login = m.org where user = ?`
func UserOrgs(login string) (orgs []*Org) {
defer measure("UserOrgs", time.Now())
mustSelect(&orgs, userOrgsQuery, login)
return
}