Пример #1
0
func Mobs(w http.ResponseWriter, r *http.Request, currentUser *model.User) error {
	mobs, err := repository.Mob().ForUser(currentUser)
	if err != nil {
		return err
	}

	return serveJSON(w, mobs)
}
Пример #2
0
func upsertMob(user *model.User, repo *octokat.Repository) (*model.Mob, error) {
	mob := model.Mob{
		Owner:        repo.Owner.Login,
		RepoName:     repo.Name,
		RepoFullName: repo.FullName,
	}

	return repository.Mob().Upsert(&mob)
}