Versions in this module Expand all Collapse all v0 v0.3.1 Mar 29, 2026 v0.3.0 Mar 18, 2026 Changes in this version + type AddCollaboratorOpts struct + Permission string + type Collaborator struct + Login string + Permission string + type CollaboratorService interface + Add func(ctx context.Context, owner, repo, username string, opts AddCollaboratorOpts) error + List func(ctx context.Context, owner, repo string, opts ListCollaboratorOpts) ([]Collaborator, error) + Remove func(ctx context.Context, owner, repo, username string) error + type CommitStatus struct + Context string + CreatedAt time.Time + Creator string + Description string + State string + TargetURL string + type CommitStatusService interface + List func(ctx context.Context, owner, repo, sha string) ([]CommitStatus, error) + Set func(ctx context.Context, owner, repo, sha string, opts SetCommitStatusOpts) (*CommitStatus, error) + type Contributor struct + Contributions int + Email string + Login string + Name string + type FileContent struct + Content []byte + Name string + Path string + SHA string + type FileEntry struct + Name string + Path string + Size int64 + Type string + type FileService interface + Get func(ctx context.Context, owner, repo, path, ref string) (*FileContent, error) + List func(ctx context.Context, owner, repo, path, ref string) ([]FileEntry, error) type Forge + Collaborators func() CollaboratorService + CommitStatuses func() CommitStatusService + Files func() FileService + GetRateLimit func(ctx context.Context) (*RateLimit, error) + Notifications func() NotificationService + Reviews func() ReviewService type IssueService + AddReaction func(ctx context.Context, owner, repo string, number int, commentID int64, ...) (*Reaction, error) + ListReactions func(ctx context.Context, owner, repo string, number int, commentID int64) ([]Reaction, error) + type ListCollaboratorOpts struct + Limit int + Page int + PerPage int + type ListForksOpts struct + Limit int + Page int + PerPage int + Sort string + type ListNotificationOpts struct + Limit int + Page int + PerPage int + Repo string + Unread bool + type ListReviewOpts struct + Limit int + Page int + PerPage int + type MarkNotificationOpts struct + ID string + Repo string + type Notification struct + ID string + Reason string + Repo string + SubjectType NotificationSubjectType + Title string + URL string + Unread bool + UpdatedAt time.Time + type NotificationService interface + Get func(ctx context.Context, id string) (*Notification, error) + List func(ctx context.Context, opts ListNotificationOpts) ([]Notification, error) + MarkRead func(ctx context.Context, opts MarkNotificationOpts) error + type NotificationSubjectType string + const NotificationSubjectCommit + const NotificationSubjectDiscussion + const NotificationSubjectIssue + const NotificationSubjectPullRequest + const NotificationSubjectRelease + const NotificationSubjectRepository type PullRequestService + AddReaction func(ctx context.Context, owner, repo string, number int, commentID int64, ...) (*Reaction, error) + ListReactions func(ctx context.Context, owner, repo string, number int, commentID int64) ([]Reaction, error) + type RateLimit struct + Limit int + Remaining int + Reset time.Time + type Reaction struct + Content string + ID int64 + User string type RepoService + ListContributors func(ctx context.Context, owner, repo string) ([]Contributor, error) + ListForks func(ctx context.Context, owner, repo string, opts ListForksOpts) ([]Repository, error) + type Review struct + Author User + Body string + HTMLURL string + ID int64 + State ReviewState + SubmittedAt time.Time + type ReviewService interface + List func(ctx context.Context, owner, repo string, number int, opts ListReviewOpts) ([]Review, error) + RemoveReviewers func(ctx context.Context, owner, repo string, number int, users []string) error + RequestReviewers func(ctx context.Context, owner, repo string, number int, users []string) error + Submit func(ctx context.Context, owner, repo string, number int, opts SubmitReviewOpts) (*Review, error) + type ReviewState string + const ReviewApproved + const ReviewChangesRequested + const ReviewCommented + const ReviewDismissed + const ReviewPending + type SetCommitStatusOpts struct + Context string + Description string + State string + TargetURL string + type SubmitReviewOpts struct + Body string + State ReviewState v0.2.0 Mar 10, 2026 Changes in this version + var ErrNotFound = errors.New("not found") + var ErrNotSupported = errors.New("not supported by this forge") + var ErrOwnerNotFound = errors.New("owner not found") + func ParseRepoURL(rawURL string) (domain, owner, repo string, err error) + type ArchivedFilter int + const ArchivedExclude + const ArchivedInclude + const ArchivedOnly + type Branch struct + Default bool + Name string + Protected bool + SHA string + type BranchService interface + Create func(ctx context.Context, owner, repo, name, from string) (*Branch, error) + Delete func(ctx context.Context, owner, repo, name string) error + List func(ctx context.Context, owner, repo string, opts ListBranchOpts) ([]Branch, error) + type CIJob struct + Conclusion string + FinishedAt *time.Time + HTMLURL string + ID int64 + Name string + StartedAt *time.Time + Status string + type CIRun struct + Author User + Branch string + Conclusion string + CreatedAt time.Time + Event string + FinishedAt *time.Time + HTMLURL string + ID int64 + Jobs []CIJob + SHA string + Status string + Title string + UpdatedAt time.Time + type CIService interface + CancelRun func(ctx context.Context, owner, repo string, runID int64) error + GetJobLog func(ctx context.Context, owner, repo string, jobID int64) (io.ReadCloser, error) + GetRun func(ctx context.Context, owner, repo string, runID int64) (*CIRun, error) + ListRuns func(ctx context.Context, owner, repo string, opts ListCIRunOpts) ([]CIRun, error) + RetryRun func(ctx context.Context, owner, repo string, runID int64) error + TriggerRun func(ctx context.Context, owner, repo string, opts TriggerCIRunOpts) error + type Client struct + func NewClient(opts ...Option) *Client + func (c *Client) FetchRepository(ctx context.Context, repoURL string) (*Repository, error) + func (c *Client) FetchRepositoryFromPURL(ctx context.Context, p *purl.PURL) (*Repository, error) + func (c *Client) FetchTags(ctx context.Context, repoURL string) ([]Tag, error) + func (c *Client) FetchTagsFromPURL(ctx context.Context, p *purl.PURL) ([]Tag, error) + func (c *Client) ForgeFor(domain string) (Forge, error) + func (c *Client) HTTPClient() *http.Client + func (c *Client) ListRepositories(ctx context.Context, domain, owner string, opts ListRepoOpts) ([]Repository, error) + func (c *Client) RegisterDomain(ctx context.Context, domain, token string, builders ForgeBuilders) error + func (c *Client) Tokens() map[string]string + type Comment struct + Author User + Body string + CreatedAt time.Time + HTMLURL string + ID int64 + UpdatedAt time.Time + type CreateDeployKeyOpts struct + Key string + ReadOnly bool + Title string + type CreateIssueOpts struct + Assignees []string + Body string + Labels []string + Milestone string + Title string + type CreateLabelOpts struct + Color string + Description string + Name string + type CreateMilestoneOpts struct + Description string + DueDate *time.Time + Title string + type CreatePROpts struct + Assignees []string + Base string + Body string + Draft bool + Head string + Labels []string + Milestone string + Reviewers []string + Title string + type CreateReleaseOpts struct + Body string + Draft bool + GenerateNotes bool + Prerelease bool + TagName string + Target string + Title string + type CreateRepoOpts struct + DefaultBranch string + Description string + Gitignore string + Init bool + License string + Name string + Owner string + Readme bool + Visibility Visibility + type DeployKey struct + CreatedAt time.Time + ID int64 + Key string + ReadOnly bool + Title string + type DeployKeyService interface + Create func(ctx context.Context, owner, repo string, opts CreateDeployKeyOpts) (*DeployKey, error) + Delete func(ctx context.Context, owner, repo string, id int64) error + Get func(ctx context.Context, owner, repo string, id int64) (*DeployKey, error) + List func(ctx context.Context, owner, repo string, opts ListDeployKeyOpts) ([]DeployKey, error) + type EditRepoOpts struct + DefaultBranch *string + Description *string + HasIssues *bool + HasPRs *bool + Homepage *string + Visibility Visibility + type Forge interface + Branches func() BranchService + CI func() CIService + DeployKeys func() DeployKeyService + Issues func() IssueService + Labels func() LabelService + Milestones func() MilestoneService + PullRequests func() PullRequestService + Releases func() ReleaseService + Repos func() RepoService + Secrets func() SecretService + type ForgeBuilders struct + GitHub func(baseURL, token string, hc *http.Client) Forge + GitLab func(baseURL, token string, hc *http.Client) Forge + Gitea func(baseURL, token string, hc *http.Client) Forge + type ForgeType string + const Bitbucket + const Forgejo + const GitHub + const GitLab + const Gitea + const Unknown + func DetectForgeType(ctx context.Context, domain string, hc ...*http.Client) (ForgeType, error) + type ForkFilter int + const ForkExclude + const ForkInclude + const ForkOnly + type ForkRepoOpts struct + Name string + Owner string + type HTTPError struct + Body string + StatusCode int + URL string + func (e *HTTPError) Error() string + type Issue struct + Assignees []User + Author User + Body string + ClosedAt *time.Time + Comments int + CreatedAt time.Time + HTMLURL string + Labels []Label + Locked bool + Milestone *Milestone + Number int + State string + Title string + UpdatedAt time.Time + type IssueService interface + Close func(ctx context.Context, owner, repo string, number int) error + Create func(ctx context.Context, owner, repo string, opts CreateIssueOpts) (*Issue, error) + CreateComment func(ctx context.Context, owner, repo string, number int, body string) (*Comment, error) + Delete func(ctx context.Context, owner, repo string, number int) error + Get func(ctx context.Context, owner, repo string, number int) (*Issue, error) + List func(ctx context.Context, owner, repo string, opts ListIssueOpts) ([]Issue, error) + ListComments func(ctx context.Context, owner, repo string, number int) ([]Comment, error) + Reopen func(ctx context.Context, owner, repo string, number int) error + Update func(ctx context.Context, owner, repo string, number int, opts UpdateIssueOpts) (*Issue, error) + type Label struct + Color string + Description string + Name string + type LabelService interface + Create func(ctx context.Context, owner, repo string, opts CreateLabelOpts) (*Label, error) + Delete func(ctx context.Context, owner, repo, name string) error + Get func(ctx context.Context, owner, repo, name string) (*Label, error) + List func(ctx context.Context, owner, repo string, opts ListLabelOpts) ([]Label, error) + Update func(ctx context.Context, owner, repo, name string, opts UpdateLabelOpts) (*Label, error) + type ListBranchOpts struct + Limit int + Page int + PerPage int + type ListCIRunOpts struct + Branch string + Limit int + Page int + PerPage int + Status string + User string + Workflow string + type ListDeployKeyOpts struct + Limit int + Page int + PerPage int + type ListIssueOpts struct + Assignee string + Author string + Labels []string + Limit int + Order string + Page int + PerPage int + Sort string + State string + type ListLabelOpts struct + Limit int + Page int + PerPage int + type ListMilestoneOpts struct + Limit int + Page int + PerPage int + State string + type ListPROpts struct + Assignee string + Author string + Base string + Head string + Labels []string + Limit int + Order string + Page int + PerPage int + Sort string + State string + type ListReleaseOpts struct + Limit int + Page int + PerPage int + type ListRepoOpts struct + Archived ArchivedFilter + Forks ForkFilter + Limit int + Order string + Page int + PerPage int + Sort string + type ListSecretOpts struct + Limit int + Page int + PerPage int + type MergePROpts struct + Delete bool + Message string + Method string + Title string + type Milestone struct + Description string + DueDate *time.Time + Number int + State string + Title string + type MilestoneService interface + Close func(ctx context.Context, owner, repo string, id int) error + Create func(ctx context.Context, owner, repo string, opts CreateMilestoneOpts) (*Milestone, error) + Delete func(ctx context.Context, owner, repo string, id int) error + Get func(ctx context.Context, owner, repo string, id int) (*Milestone, error) + List func(ctx context.Context, owner, repo string, opts ListMilestoneOpts) ([]Milestone, error) + Reopen func(ctx context.Context, owner, repo string, id int) error + Update func(ctx context.Context, owner, repo string, id int, opts UpdateMilestoneOpts) (*Milestone, error) + type Option func(*Client) + func WithForge(domain string, f Forge) Option + func WithHTTPClient(hc *http.Client) Option + func WithToken(domain, token string) Option + type PullRequest struct + Additions int + Assignees []User + Author User + Base string + Body string + ChangedFiles int + ClosedAt *time.Time + Comments int + CreatedAt time.Time + Deletions int + DiffURL string + Draft bool + HTMLURL string + Head string + Labels []Label + Mergeable bool + Merged bool + MergedAt *time.Time + MergedBy *User + Milestone *Milestone + Number int + Reviewers []User + State string + Title string + UpdatedAt time.Time + type PullRequestService interface + Close func(ctx context.Context, owner, repo string, number int) error + Create func(ctx context.Context, owner, repo string, opts CreatePROpts) (*PullRequest, error) + CreateComment func(ctx context.Context, owner, repo string, number int, body string) (*Comment, error) + Diff func(ctx context.Context, owner, repo string, number int) (string, error) + Get func(ctx context.Context, owner, repo string, number int) (*PullRequest, error) + List func(ctx context.Context, owner, repo string, opts ListPROpts) ([]PullRequest, error) + ListComments func(ctx context.Context, owner, repo string, number int) ([]Comment, error) + Merge func(ctx context.Context, owner, repo string, number int, opts MergePROpts) error + Reopen func(ctx context.Context, owner, repo string, number int) error + Update func(ctx context.Context, owner, repo string, number int, opts UpdatePROpts) (*PullRequest, error) + type Release struct + Assets []ReleaseAsset + Author User + Body string + CreatedAt time.Time + Draft bool + HTMLURL string + Prerelease bool + PublishedAt time.Time + TagName string + TarballURL string + Target string + Title string + ZipballURL string + type ReleaseAsset struct + CreatedAt time.Time + DownloadCount int + DownloadURL string + ID int64 + Name string + Size int + type ReleaseService interface + Create func(ctx context.Context, owner, repo string, opts CreateReleaseOpts) (*Release, error) + Delete func(ctx context.Context, owner, repo, tag string) error + DownloadAsset func(ctx context.Context, owner, repo string, assetID int64) (io.ReadCloser, error) + Get func(ctx context.Context, owner, repo, tag string) (*Release, error) + GetLatest func(ctx context.Context, owner, repo string) (*Release, error) + List func(ctx context.Context, owner, repo string, opts ListReleaseOpts) ([]Release, error) + Update func(ctx context.Context, owner, repo, tag string, opts UpdateReleaseOpts) (*Release, error) + UploadAsset func(ctx context.Context, owner, repo, tag string, file *os.File) (*ReleaseAsset, error) + type RepoService interface + Create func(ctx context.Context, opts CreateRepoOpts) (*Repository, error) + Delete func(ctx context.Context, owner, repo string) error + Edit func(ctx context.Context, owner, repo string, opts EditRepoOpts) (*Repository, error) + Fork func(ctx context.Context, owner, repo string, opts ForkRepoOpts) (*Repository, error) + Get func(ctx context.Context, owner, repo string) (*Repository, error) + List func(ctx context.Context, owner string, opts ListRepoOpts) ([]Repository, error) + ListTags func(ctx context.Context, owner, repo string) ([]Tag, error) + Search func(ctx context.Context, opts SearchRepoOpts) ([]Repository, error) + type Repository struct + Archived bool + CloneURL string + CreatedAt time.Time + DefaultBranch string + Description string + Fork bool + ForksCount int + FullName string + HTMLURL string + HasIssues bool + Homepage string + Language string + License string + LogoURL string + MirrorURL string + Name string + OpenIssuesCount int + Owner string + Private bool + PullRequestsEnabled bool + PushedAt time.Time + SSHURL string + Size int + SourceName string + StargazersCount int + SubscribersCount int + Topics []string + UpdatedAt time.Time + func FilterRepos(repos []Repository, opts ListRepoOpts) []Repository + type SearchRepoOpts struct + Limit int + Order string + Page int + PerPage int + Query string + Sort string + type Secret struct + CreatedAt time.Time + Name string + UpdatedAt time.Time + type SecretService interface + Delete func(ctx context.Context, owner, repo, name string) error + List func(ctx context.Context, owner, repo string, opts ListSecretOpts) ([]Secret, error) + Set func(ctx context.Context, owner, repo string, opts SetSecretOpts) error + type SetSecretOpts struct + Name string + Value string + type Tag struct + Commit string + Name string + type TriggerCIRunOpts struct + Branch string + Inputs map[string]string + Workflow string + type UpdateIssueOpts struct + Assignees []string + Body *string + Labels []string + Milestone *string + Title *string + type UpdateLabelOpts struct + Color *string + Description *string + Name *string + type UpdateMilestoneOpts struct + Description *string + DueDate *time.Time + State *string + Title *string + type UpdatePROpts struct + Assignees []string + Base *string + Body *string + Labels []string + Milestone *string + Reviewers []string + Title *string + type UpdateReleaseOpts struct + Body *string + Draft *bool + Prerelease *bool + TagName *string + Target *string + Title *string + type User struct + AvatarURL string + Email string + HTMLURL string + IsOrg bool + Login string + Name string + type Visibility int + const VisibilityDefault + const VisibilityInternal + const VisibilityPrivate + const VisibilityPublic