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

Function GetLabelsInRepoByIDs

internal/database/issue_label.go:182–185  ·  view source on GitHub ↗

GetLabelsInRepoByIDs returns a list of labels by IDs in given repository, it silently ignores label IDs that are not belong to the repository.

(repoID int64, labelIDs []int64)

Source from the content-addressed store, hash-verified

180// GetLabelsInRepoByIDs returns a list of labels by IDs in given repository,
181// it silently ignores label IDs that are not belong to the repository.
182func GetLabelsInRepoByIDs(repoID int64, labelIDs []int64) ([]*Label, error) {
183 labels := make([]*Label, 0, len(labelIDs))
184 return labels, x.Where("repo_id = ?", repoID).In("id", tool.Int64sToStrings(labelIDs)).Asc("name").Find(&labels)
185}
186
187// GetLabelsByRepoID returns all labels that belong to given repository by ID.
188func GetLabelsByRepoID(repoID int64) ([]*Label, error) {

Callers 2

AddIssueLabelsFunction · 0.92
ReplaceIssueLabelsFunction · 0.92

Calls 4

Int64sToStringsFunction · 0.92
InMethod · 0.80
WhereMethod · 0.80
FindMethod · 0.65

Tested by

no test coverage detected