go-forge/forge.go
Snider 33319590d4 feat: WikiService, MiscService, CommitService
Add three new services completing the final service layer:

- WikiService: CRUD operations for repository wiki pages
- MiscService: markdown rendering, licence/gitignore templates, nodeinfo, version
- CommitService: commit statuses (list, create, combined) and git notes
- PostRaw method on Client for endpoints returning raw text (e.g. /markdown)
- Remove services_stub.go (all stubs now replaced with real implementations)
- Wire Commits field into Forge struct

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 17:14:01 +00:00

53 lines
1.5 KiB
Go

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 }