Versions in this module Expand all Collapse all v0 v0.1.7 Oct 21, 2026 Changes in this version + var AllTeamUnits = []TeamUnit + var ErrNotSupported = errors.New("operation not supported") + var ErrOwnerTeam = errors.New("refusing to delete, rename or change the permissions of an owner team") + func All[T any](ctx context.Context, opts ListOptions, ...) iter.Seq2[T, error] + func IsForbidden(err error) bool + func IsNotFound(err error) bool + func IsUnauthorized(err error) bool + func NotSupported(backend Backend, operation, reason string) error + func Ptr[T any](v T) *T + func StatusCode(err error) int + type APIError struct + Backend Backend + Details []string + DocumentationURL string + Message string + StatusCode int + func (e *APIError) Error() string + type Admin interface + Orgs func() Orgs + Teams func() Teams + Users func() Users + type Allowlist struct + Teams []string + Users []string + type Asset struct + ContentType string + CreatedAt time.Time + DownloadCount int64 + DownloadURL string + External bool + ID int64 + Name string + Size int64 + type Backend string + const BackendBitbucket + const BackendForgejo + const BackendGitHub + type Branch struct + IsDefault bool + Name string + Protected bool + SHA string + type BranchProtection struct + AllowDeletion bool + AllowForcePush bool + ApplyToAdmins bool + ApprovalsAllowlist *Allowlist + BlockOnOfficialReviewRequests bool + BlockOnRejectedReviews bool + DismissStaleApprovals bool + ID int64 + MergeAllowlist *Allowlist + Pattern string + ProtectedFilePatterns string + PushAllowlist *Allowlist + RequireConversationResolution bool + RequireLinearHistory bool + RequireSignedCommits bool + RequireUpToDate bool + RequiredApprovals int + RequiredStatusChecks []string + UnprotectedFilePatterns string + type BranchProtections interface + Create func(ctx context.Context, owner, repo string, rule BranchProtection) (*BranchProtection, error) + Delete func(ctx context.Context, owner, repo, pattern string) error + Get func(ctx context.Context, owner, repo, pattern string) (*BranchProtection, error) + List func(ctx context.Context, owner, repo string) ([]BranchProtection, error) + Update func(ctx context.Context, owner, repo, pattern string, rule BranchProtection) (*BranchProtection, error) + type Branches interface + Create func(ctx context.Context, owner, repo string, opts CreateBranchOptions) (*Branch, error) + Delete func(ctx context.Context, owner, repo, name string) error + Get func(ctx context.Context, owner, repo, name string) (*Branch, error) + List func(ctx context.Context, owner, repo string, opts ListOptions) (Page[Branch], error) + Rename func(ctx context.Context, owner, repo, name, newName string) (*Branch, error) + type Capability uint64 + const CapAdmin + const CapBranchProtection + const CapBranches + const CapExternalAssets + const CapIssues + const CapMigrate + const CapMirrors + const CapPullRequests + const CapReleases + const CapRepos + const CapSystemWebhooks + const CapTagProtection + const CapTags + const CapWebhooks + func (c Capability) Has(want Capability) bool + func (c Capability) String() string + type Client interface + Backend func() Backend + BranchProtections func() BranchProtections + Branches func() Branches + Capabilities func() Capability + Issues func() Issues + Labels func() Labels + Milestones func() Milestones + PullRequests func() PullRequests + Releases func() Releases + Repos func() Repos + TagProtections func() TagProtections + Tags func() Tags + Webhooks func() Webhooks + type Comment struct + Author string + Body string + CreatedAt time.Time + HTMLURL string + ID int64 + UpdatedAt time.Time + type CreateBranchOptions struct + From string + Name string + type CreateIssueOptions struct + Assignees []string + Body string + Labels []string + Milestone int64 + Title string + type CreateMilestoneOptions struct + Description string + DueOn time.Time + Title string + type CreateOrgOptions struct + Description string + Email string + FullName string + Location string + Name string + Owner string + RepoAdminChangeTeamAccess bool + Visibility OwnerVisibility + Website string + type CreatePROptions struct + AllowMaintainerEdit *bool + Base string + Body string + Draft bool + Head string + Title string + type CreateReleaseOptions struct + Body string + Draft bool + GenerateReleaseNotes bool + HideArchiveLinks *bool + MakeLatest *bool + Name string + Prerelease bool + TagName string + TargetCommitish string + type CreateRepoOptions struct + AutoInit bool + DefaultBranch string + Description string + Gitignores []string + License string + Name string + Owner string + Template bool + Visibility Visibility + type CreateReviewOptions struct + Body string + CommitID string + Event ReviewEvent + type CreateTagOptions struct + Message string + Name string + Target string + type CreateTeamOptions struct + Access TeamAccess + CanCreateOrgRepo bool + Description string + IncludesAllRepos bool + Name string + type CreateUserOptions struct + Email string + FullName string + Login string + MustChangePassword *bool + Password string + Restricted bool + SendNotify bool + Visibility OwnerVisibility + type CreateWebhookOptions struct + Active *bool + AuthorizationHeader string + BranchFilter string + ContentType HookContentType + Events []HookEvent + Secret string + URL string + type DeleteUserOptions struct + Purge bool + type EditAssetOptions struct + Name *string + type EditIssueOptions struct + Assignees *[]string + Body *string + Labels *[]string + Milestone *int64 + State *IssueState + Title *string + type EditLabelOptions struct + Color *string + Description *string + Name *string + type EditMilestoneOptions struct + Description *string + DueOn *time.Time + State *MilestoneState + Title *string + type EditOrgOptions struct + Description *string + Email *string + FullName *string + Location *string + RepoAdminChangeTeamAccess *bool + Visibility *OwnerVisibility + Website *string + type EditPROptions struct + AllowMaintainerEdit *bool + Base *string + Body *string + Draft *bool + State *PRState + Title *string + type EditReleaseOptions struct + Body *string + Draft *bool + HideArchiveLinks *bool + MakeLatest *bool + Name *string + Prerelease *bool + TagName *string + TargetCommitish *string + type EditRepoOptions struct + Archived *bool + DefaultBranch *string + Description *string + Name *string + Template *bool + Visibility *Visibility + Website *string + type EditTeamOptions struct + Access *TeamAccess + CanCreateOrgRepo *bool + Description *string + IncludesAllRepos *bool + Name *string + type EditUserOptions struct + Active *bool + Admin *bool + AllowCreateOrganization *bool + Description *string + Email *string + FullName *string + Location *string + MaxRepoCreation *int + MustChangePassword *bool + Password *string + ProhibitLogin *bool + Restricted *bool + Visibility *OwnerVisibility + Website *string + type EditWebhookOptions struct + Active *bool + AuthorizationHeader *string + BranchFilter *string + ContentType *HookContentType + Events []HookEvent + Secret *string + URL *string + type ExternalAssets interface + AddExternalAsset func(ctx context.Context, owner, repo string, releaseID int64, name, url string) (*Asset, error) + type HookContentType string + const HookContentForm + const HookContentJSON + type HookEvent string + const HookEventCreate + const HookEventDelete + const HookEventFork + const HookEventIssueComment + const HookEventIssues + const HookEventPullRequest + const HookEventPullRequestReview + const HookEventPush + const HookEventRelease + const HookEventRepository + const HookEventWiki + type HookScope struct + Owner string + Repo string + func OrgHooks(org string) HookScope + func RepoHooks(owner, repo string) HookScope + type Issue struct + Assignees []string + Author string + Body string + ClosedAt time.Time + Comments int + CreatedAt time.Time + HTMLURL string + Labels []string + Locked bool + Milestone *Milestone + Number int + State IssueState + Title string + UpdatedAt time.Time + type IssueState string + const IssueStateAll + const IssueStateClosed + const IssueStateOpen + type Issues interface + AddLabels func(ctx context.Context, owner, repo string, number int, labels []string) error + Create func(ctx context.Context, owner, repo string, opts CreateIssueOptions) (*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 + DeleteComment func(ctx context.Context, owner, repo string, id int64) error + Edit func(ctx context.Context, owner, repo string, number int, opts EditIssueOptions) (*Issue, error) + EditComment func(ctx context.Context, owner, repo string, id int64, body string) (*Comment, error) + Get func(ctx context.Context, owner, repo string, number int) (*Issue, error) + List func(ctx context.Context, owner, repo string, opts ListIssuesOptions) (Page[Issue], error) + ListComments func(ctx context.Context, owner, repo string, number int, opts ListOptions) (Page[Comment], error) + RemoveLabel func(ctx context.Context, owner, repo string, number int, label string) error + type Label struct + Color string + Description string + ID int64 + Name string + type Labels interface + Create func(ctx context.Context, owner, repo string, label Label) (*Label, error) + Delete func(ctx context.Context, owner, repo, name string) error + Edit func(ctx context.Context, owner, repo, name string, opts EditLabelOptions) (*Label, error) + Get func(ctx context.Context, owner, repo, name string) (*Label, error) + List func(ctx context.Context, owner, repo string, opts ListOptions) (Page[Label], error) + type ListIssuesOptions struct + Labels []string + State IssueState + type ListOptions struct + Page int + PerPage int + type ListPROptions struct + State PRState + type MergeMethod string + const MergeMethodFastForwardOnly + const MergeMethodManuallyMerged + const MergeMethodMerge + const MergeMethodRebase + const MergeMethodRebaseMerge + const MergeMethodSquash + func (m MergeMethod) Valid() bool + type MergeOptions struct + DeleteBranch bool + HeadSHA string + Message string + Method MergeMethod + Title string + WhenChecksSucceed bool + type Milestone struct + ClosedAt time.Time + ClosedIssues int + Description string + DueOn time.Time + ID int64 + OpenIssues int + State MilestoneState + Title string + type MilestoneState string + const MilestoneStateAll + const MilestoneStateClosed + const MilestoneStateOpen + type Milestones interface + Create func(ctx context.Context, owner, repo string, opts CreateMilestoneOptions) (*Milestone, error) + Delete func(ctx context.Context, owner, repo string, id int64) error + Edit func(ctx context.Context, owner, repo string, id int64, opts EditMilestoneOptions) (*Milestone, error) + Get func(ctx context.Context, owner, repo string, id int64) (*Milestone, error) + List func(ctx context.Context, owner, repo string, state MilestoneState, ...) (Page[Milestone], error) + type NotSupportedError struct + Backend Backend + Operation string + Reason string + func (e *NotSupportedError) Error() string + func (e *NotSupportedError) Is(target error) bool + type Org struct + Description string + Email string + FullName string + ID int64 + Location string + Name string + RepoAdminChangeTeamAccess bool + Visibility OwnerVisibility + Website string + type Orgs interface + Create func(ctx context.Context, opts CreateOrgOptions) (*Org, error) + Delete func(ctx context.Context, name string) error + Edit func(ctx context.Context, name string, opts EditOrgOptions) (*Org, error) + Get func(ctx context.Context, name string) (*Org, error) + IsMember func(ctx context.Context, org, user string) (bool, error) + List func(ctx context.Context, user string, opts ListOptions) (Page[Org], error) + ListAll func(ctx context.Context, opts ListOptions) (Page[Org], error) + Members func(ctx context.Context, org string, opts ListOptions) (Page[User], error) + RemoveMember func(ctx context.Context, org, user string) error + Rename func(ctx context.Context, name, newName string) error + type OwnerVisibility string + const OwnerVisibilityLimited + const OwnerVisibilityPrivate + const OwnerVisibilityPublic + func (v OwnerVisibility) Valid() bool + type PRBranch struct + Ref string + Repo string + SHA string + type PRState string + const PRStateAll + const PRStateClosed + const PRStateOpen + type Page struct + Items []T + NextPage int + type PullRequest struct + Author string + Base PRBranch + Body string + ClosedAt time.Time + CreatedAt time.Time + Draft bool + HTMLURL string + Head PRBranch + MergeCommitSHA string + Mergeable *bool + Merged bool + MergedAt time.Time + MergedBy string + Number int + State PRState + Title string + UpdatedAt time.Time + type PullRequests interface + CancelAutoMerge func(ctx context.Context, owner, repo string, number int) error + Create func(ctx context.Context, owner, repo string, opts CreatePROptions) (*PullRequest, error) + CreateReview func(ctx context.Context, owner, repo string, number int, opts CreateReviewOptions) (*Review, error) + Edit func(ctx context.Context, owner, repo string, number int, opts EditPROptions) (*PullRequest, error) + Get func(ctx context.Context, owner, repo string, number int) (*PullRequest, error) + IsMerged func(ctx context.Context, owner, repo string, number int) (bool, error) + List func(ctx context.Context, owner, repo string, opts ListPROptions) (Page[PullRequest], error) + ListReviews func(ctx context.Context, owner, repo string, number int, opts ListOptions) (Page[Review], error) + Merge func(ctx context.Context, owner, repo string, number int, opts MergeOptions) error + RemoveReviewers func(ctx context.Context, owner, repo string, number int, users, teams []string) error + RequestReviewers func(ctx context.Context, owner, repo string, number int, users, teams []string) error + type Release struct + Assets []Asset + Author string + Body string + CreatedAt time.Time + Draft bool + HTMLURL string + ID int64 + Name string + Prerelease bool + PublishedAt time.Time + TagName string + TarballURL string + TargetCommitish string + ZipballURL string + type Releases interface + Create func(ctx context.Context, owner, repo string, opts CreateReleaseOptions) (*Release, error) + Delete func(ctx context.Context, owner, repo string, id int64) error + DeleteAsset func(ctx context.Context, owner, repo string, releaseID, assetID int64) error + DownloadAsset func(ctx context.Context, owner, repo string, releaseID, assetID int64) (io.ReadCloser, error) + Edit func(ctx context.Context, owner, repo string, id int64, opts EditReleaseOptions) (*Release, error) + EditAsset func(ctx context.Context, owner, repo string, releaseID, assetID int64, ...) (*Asset, error) + Get func(ctx context.Context, owner, repo string, id int64) (*Release, error) + GetAsset func(ctx context.Context, owner, repo string, releaseID, assetID int64) (*Asset, error) + GetByTag func(ctx context.Context, owner, repo, tag string) (*Release, error) + Latest func(ctx context.Context, owner, repo string) (*Release, error) + List func(ctx context.Context, owner, repo string, opts ListOptions) (Page[Release], error) + ListAssets func(ctx context.Context, owner, repo string, releaseID int64, opts ListOptions) (Page[Asset], error) + UploadAsset func(ctx context.Context, owner, repo string, releaseID int64, name string, ...) (*Asset, error) + type Repo struct + Archived bool + CloneURL string + CreatedAt time.Time + DefaultBranch string + Description string + Empty bool + Fork bool + FullName string + HTMLURL string + ID int64 + Mirror bool + Name string + Owner string + SSHURL string + Template bool + UpdatedAt time.Time + Visibility Visibility + Website string + type Repos interface + Create func(ctx context.Context, opts CreateRepoOptions) (*Repo, error) + Delete func(ctx context.Context, owner, name string) error + Edit func(ctx context.Context, owner, name string, opts EditRepoOptions) (*Repo, error) + Get func(ctx context.Context, owner, name string) (*Repo, error) + List func(ctx context.Context, owner string, opts ListOptions) (Page[Repo], error) + type Review struct + Body string + CommitID string + HTMLURL string + ID int64 + Reviewer string + State ReviewState + SubmittedAt time.Time + type ReviewEvent string + const ReviewEventApprove + const ReviewEventComment + const ReviewEventRequestChanges + type ReviewState string + const ReviewApproved + const ReviewChangesRequested + const ReviewCommented + const ReviewDismissed + const ReviewPending + const ReviewRequested + type Tag struct + Message string + Name string + SHA string + TarballURL string + ZipballURL string + type TagProtection struct + Allowlist Allowlist + ID int64 + Pattern string + type TagProtections interface + Create func(ctx context.Context, owner, repo string, rule TagProtection) (*TagProtection, error) + Delete func(ctx context.Context, owner, repo, pattern string) error + Get func(ctx context.Context, owner, repo, pattern string) (*TagProtection, error) + List func(ctx context.Context, owner, repo string) ([]TagProtection, error) + Update func(ctx context.Context, owner, repo, pattern string, rule TagProtection) (*TagProtection, error) + type Tags interface + Create func(ctx context.Context, owner, repo string, opts CreateTagOptions) (*Tag, error) + Delete func(ctx context.Context, owner, repo, name string) error + Get func(ctx context.Context, owner, repo, name string) (*Tag, error) + List func(ctx context.Context, owner, repo string, opts ListOptions) (Page[Tag], error) + type Team struct + CanCreateOrgRepo bool + Description string + ID int64 + IncludesAllRepos bool + Name string + Org string + Permission TeamPermission + Units map[TeamUnit]TeamPermission + type TeamAccess struct + Permission TeamPermission + Units map[TeamUnit]TeamPermission + type TeamPermission string + const TeamPermissionAdmin + const TeamPermissionNone + const TeamPermissionOwner + const TeamPermissionRead + const TeamPermissionWrite + type TeamUnit string + const TeamUnitActions + const TeamUnitCode + const TeamUnitExternalIssues + const TeamUnitExternalWiki + const TeamUnitIssues + const TeamUnitPackages + const TeamUnitProjects + const TeamUnitPulls + const TeamUnitReleases + const TeamUnitWiki + type Teams interface + AddMember func(ctx context.Context, id int64, user string) error + AddRepo func(ctx context.Context, id int64, owner, repo string) error + Create func(ctx context.Context, org string, opts CreateTeamOptions) (*Team, error) + Delete func(ctx context.Context, id int64) error + Edit func(ctx context.Context, id int64, opts EditTeamOptions) (*Team, error) + Get func(ctx context.Context, id int64) (*Team, error) + GetByName func(ctx context.Context, org, name string) (*Team, error) + IsMember func(ctx context.Context, id int64, user string) (bool, error) + List func(ctx context.Context, org string, opts ListOptions) (Page[Team], error) + Members func(ctx context.Context, id int64, opts ListOptions) (Page[User], error) + RemoveMember func(ctx context.Context, id int64, user string) error + RemoveRepo func(ctx context.Context, id int64, owner, repo string) error + Repos func(ctx context.Context, id int64, opts ListOptions) (Page[Repo], error) + type UnsupportedVersionError struct + Backend Backend + Minimum string + Version string + func (e *UnsupportedVersionError) Error() string + type User struct + Active bool + CreatedAt time.Time + Description string + Email string + FullName string + HTMLURL string + ID int64 + IsAdmin bool + LastLogin time.Time + Location string + Login string + ProhibitLogin bool + Restricted bool + Visibility OwnerVisibility + Website string + type Users interface + Create func(ctx context.Context, opts CreateUserOptions) (*User, error) + Delete func(ctx context.Context, login string, opts DeleteUserOptions) error + Edit func(ctx context.Context, login string, opts EditUserOptions) (*User, error) + Get func(ctx context.Context, login string) (*User, error) + List func(ctx context.Context, opts ListOptions) (Page[User], error) + Rename func(ctx context.Context, login, newLogin string) error + type Visibility string + const VisibilityInternal + const VisibilityPrivate + const VisibilityPublic + func (v Visibility) Valid() bool + type Webhook struct + Active bool + BranchFilter string + ContentType HookContentType + CreatedAt time.Time + Events []HookEvent + ID int64 + URL string + UpdatedAt time.Time + type Webhooks interface + Create func(ctx context.Context, scope HookScope, opts CreateWebhookOptions) (*Webhook, error) + Delete func(ctx context.Context, scope HookScope, id int64) error + Edit func(ctx context.Context, scope HookScope, id int64, opts EditWebhookOptions) (*Webhook, error) + Get func(ctx context.Context, scope HookScope, id int64) (*Webhook, error) + List func(ctx context.Context, scope HookScope, opts ListOptions) (Page[Webhook], error) + Ping func(ctx context.Context, scope HookScope, id int64) error v0.1.6 Oct 20, 2026 v0.1.5 Oct 20, 2026 v0.1.0 Oct 18, 2026