MCPcopy Create free account
hub / github.com/gogs/gogs / Issues

Function Issues

internal/database/issue.go:990–1011  ·  view source on GitHub ↗

Issues returns a list of issues by given conditions.

(opts *IssuesOptions)

Source from the content-addressed store, hash-verified

988
989// Issues returns a list of issues by given conditions.
990func Issues(opts *IssuesOptions) ([]*Issue, error) {
991 sess := buildIssuesQuery(opts)
992 if sess == nil {
993 return make([]*Issue, 0), nil
994 }
995
996 sess.Limit(conf.UI.IssuePagingNum, (opts.Page-1)*conf.UI.IssuePagingNum)
997
998 issues := make([]*Issue, 0, conf.UI.IssuePagingNum)
999 if err := sess.Find(&issues); err != nil {
1000 return nil, errors.Newf("find: %v", err)
1001 }
1002
1003 // FIXME: use IssueList to improve performance.
1004 for i := range issues {
1005 if err := issues[i].LoadAttributes(); err != nil {
1006 return nil, errors.Newf("LoadAttributes [%d]: %v", issues[i].ID, err)
1007 }
1008 }
1009
1010 return issues, nil
1011}
1012
1013// GetParticipantsByIssueID returns all users who are participated in comments of an issue.
1014func GetParticipantsByIssueID(issueID int64) ([]*User, error) {

Callers 3

IssuesFunction · 0.92
issuesFunction · 0.92
listIssuesFunction · 0.92

Calls 3

buildIssuesQueryFunction · 0.85
FindMethod · 0.65
LoadAttributesMethod · 0.45

Tested by

no test coverage detected