2026-02-21 15:43:14 +00:00
|
|
|
package forge
|
|
|
|
|
|
|
|
|
|
// Forge is the top-level client for the Forgejo API.
|
2026-03-26 18:00:20 +00:00
|
|
|
//
|
|
|
|
|
// Usage:
|
|
|
|
|
//
|
|
|
|
|
// f := forge.NewForge("https://forge.lthn.ai", "token")
|
|
|
|
|
// _ = f.Repos
|
2026-02-21 15:43:14 +00:00
|
|
|
type Forge struct {
|
|
|
|
|
client *Client
|
2026-02-21 15:46:10 +00:00
|
|
|
|
|
|
|
|
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
|
2026-02-21 16:11:29 +00:00
|
|
|
Commits *CommitService
|
2026-03-23 12:53:10 +00:00
|
|
|
Milestones *MilestoneService
|
2026-04-02 02:04:26 +00:00
|
|
|
ActivityPub *ActivityPubService
|
2026-02-21 15:43:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewForge creates a new Forge client.
|
2026-03-26 18:00:20 +00:00
|
|
|
//
|
|
|
|
|
// Usage:
|
|
|
|
|
//
|
|
|
|
|
// f := forge.NewForge("https://forge.lthn.ai", "token")
|
|
|
|
|
// _ = f
|
2026-02-21 15:43:14 +00:00
|
|
|
func NewForge(url, token string, opts ...Option) *Forge {
|
|
|
|
|
c := NewClient(url, token, opts...)
|
2026-02-21 15:46:10 +00:00
|
|
|
f := &Forge{client: c}
|
|
|
|
|
f.Repos = newRepoService(c)
|
2026-02-21 15:50:22 +00:00
|
|
|
f.Issues = newIssueService(c)
|
|
|
|
|
f.Pulls = newPullService(c)
|
2026-02-21 15:53:29 +00:00
|
|
|
f.Orgs = newOrgService(c)
|
|
|
|
|
f.Users = newUserService(c)
|
|
|
|
|
f.Teams = newTeamService(c)
|
2026-02-21 15:57:09 +00:00
|
|
|
f.Admin = newAdminService(c)
|
2026-02-21 15:59:43 +00:00
|
|
|
f.Branches = newBranchService(c)
|
|
|
|
|
f.Releases = newReleaseService(c)
|
2026-02-21 16:03:46 +00:00
|
|
|
f.Labels = newLabelService(c)
|
|
|
|
|
f.Webhooks = newWebhookService(c)
|
2026-02-21 16:07:43 +00:00
|
|
|
f.Notifications = newNotificationService(c)
|
|
|
|
|
f.Packages = newPackageService(c)
|
|
|
|
|
f.Actions = newActionsService(c)
|
2026-02-21 16:03:46 +00:00
|
|
|
f.Contents = newContentService(c)
|
2026-02-21 16:11:29 +00:00
|
|
|
f.Wiki = newWikiService(c)
|
|
|
|
|
f.Misc = newMiscService(c)
|
|
|
|
|
f.Commits = newCommitService(c)
|
2026-03-23 12:53:10 +00:00
|
|
|
f.Milestones = newMilestoneService(c)
|
2026-04-02 02:04:26 +00:00
|
|
|
f.ActivityPub = newActivityPubService(c)
|
2026-02-21 15:46:10 +00:00
|
|
|
return f
|
2026-02-21 15:43:14 +00:00
|
|
|
}
|
2026-02-21 15:46:10 +00:00
|
|
|
|
|
|
|
|
// Client returns the underlying HTTP client.
|
|
|
|
|
func (f *Forge) Client() *Client { return f.client }
|