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

Method getCollaborators

internal/database/repo_collaboration.go:101–119  ·  view source on GitHub ↗
(e Engine)

Source from the content-addressed store, hash-verified

99}
100
101func (r *Repository) getCollaborators(e Engine) ([]*Collaborator, error) {
102 collaborations, err := r.getCollaborations(e)
103 if err != nil {
104 return nil, errors.Newf("getCollaborations: %v", err)
105 }
106
107 collaborators := make([]*Collaborator, len(collaborations))
108 for i, c := range collaborations {
109 user, err := getUserByID(e, c.UserID)
110 if err != nil {
111 return nil, err
112 }
113 collaborators[i] = &Collaborator{
114 User: user,
115 Collaboration: c,
116 }
117 }
118 return collaborators, nil
119}
120
121// GetCollaborators returns the collaborators for a repository
122func (r *Repository) GetCollaborators() ([]*Collaborator, error) {

Callers 2

GetCollaboratorsMethod · 0.95
TransferOwnershipFunction · 0.80

Implementers 2

Repositoryinternal/database/repo.go
mailerRepointernal/database/issue_mail.go

Calls 2

getCollaborationsMethod · 0.95
getUserByIDFunction · 0.85

Tested by

no test coverage detected