-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforge.go
More file actions
53 lines (49 loc) · 1.46 KB
/
forge.go
File metadata and controls
53 lines (49 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package forge
// Forge is the top-level client for the Forgejo API.
type Forge struct {
client *Client
Repos *RepoService
Issues *IssueService
Pulls *PullService
Orgs *OrgService
Users *UserService
Teams *TeamService
Admin *AdminService
Branches *BranchService
Releases *ReleaseService
Labels *LabelService
Webhooks *WebhookService
Notifications *NotificationService
Packages *PackageService
Actions *ActionsService
Contents *ContentService
Wiki *WikiService
Misc *MiscService
Commits *CommitService
}
// NewForge creates a new Forge client.
func NewForge(url, token string, opts ...Option) *Forge {
c := NewClient(url, token, opts...)
f := &Forge{client: c}
f.Repos = newRepoService(c)
f.Issues = newIssueService(c)
f.Pulls = newPullService(c)
f.Orgs = newOrgService(c)
f.Users = newUserService(c)
f.Teams = newTeamService(c)
f.Admin = newAdminService(c)
f.Branches = newBranchService(c)
f.Releases = newReleaseService(c)
f.Labels = newLabelService(c)
f.Webhooks = newWebhookService(c)
f.Notifications = newNotificationService(c)
f.Packages = newPackageService(c)
f.Actions = newActionsService(c)
f.Contents = newContentService(c)
f.Wiki = newWikiService(c)
f.Misc = newMiscService(c)
f.Commits = newCommitService(c)
return f
}
// Client returns the underlying HTTP client.
func (f *Forge) Client() *Client { return f.client }