github

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubClient

type GitHubClient struct {
	// contains filtered or unexported fields
}

func NewGitHubClient

func NewGitHubClient(owner, repo, token string) *GitHubClient

func NewGitHubClientWithServices

func NewGitHubClientWithServices(
	prService PullRequestsService,
	issuesService IssuesService,
	repoService RepositoriesService,
	releaseService ReleasesService,
	usersService UsersService,
	owner string,
	repo string,
) *GitHubClient

func (*GitHubClient) AddLabelsToPR

func (ghc *GitHubClient) AddLabelsToPR(ctx context.Context, prNumber int, labels []string) error

func (*GitHubClient) CreateIssue

func (ghc *GitHubClient) CreateIssue(ctx context.Context, title string, body string, labels []string, assignees []string) (*models.Issue, error)

func (*GitHubClient) CreateLabel

func (ghc *GitHubClient) CreateLabel(ctx context.Context, name, color, description string) error

func (*GitHubClient) CreateRelease

func (ghc *GitHubClient) CreateRelease(ctx context.Context, release *models.Release, notes *models.ReleaseNotes, draft bool, buildBinaries bool, progressCh chan<- models.BuildProgress) error

func (*GitHubClient) GetAuthenticatedUser

func (ghc *GitHubClient) GetAuthenticatedUser(ctx context.Context) (string, error)

func (*GitHubClient) GetClosedIssuesBetweenTags

func (ghc *GitHubClient) GetClosedIssuesBetweenTags(ctx context.Context, previousTag, _ string) ([]models.Issue, error)

func (*GitHubClient) GetContributorsBetweenTags

func (ghc *GitHubClient) GetContributorsBetweenTags(ctx context.Context, previousTag, currentTag string) ([]string, error)

func (*GitHubClient) GetFileAtTag

func (ghc *GitHubClient) GetFileAtTag(ctx context.Context, tag, filepath string) (string, error)

func (*GitHubClient) GetFileStatsBetweenTags

func (ghc *GitHubClient) GetFileStatsBetweenTags(ctx context.Context, previousTag, currentTag string) (*models.FileStatistics, error)

func (*GitHubClient) GetIssue

func (ghc *GitHubClient) GetIssue(ctx context.Context, issueNumber int) (*models.Issue, error)

func (*GitHubClient) GetMergedPRsBetweenTags

func (ghc *GitHubClient) GetMergedPRsBetweenTags(ctx context.Context, previousTag, _ string) ([]models.PullRequest, error)

func (*GitHubClient) GetPR

func (ghc *GitHubClient) GetPR(ctx context.Context, prNumber int) (models.PRData, error)

func (*GitHubClient) GetPRIssues

func (ghc *GitHubClient) GetPRIssues(ctx context.Context, branchName string, commits []string, prDescription string) ([]models.Issue, error)

func (*GitHubClient) GetRelease

func (ghc *GitHubClient) GetRelease(ctx context.Context, version string) (*models.VCSRelease, error)

func (*GitHubClient) GetRepoLabels

func (ghc *GitHubClient) GetRepoLabels(ctx context.Context) ([]string, error)

func (*GitHubClient) GetRepoLabelsWithDescriptions added in v1.8.0

func (ghc *GitHubClient) GetRepoLabelsWithDescriptions(ctx context.Context) ([]models.RepoLabel, error)

func (*GitHubClient) ListOpenIssues added in v1.8.0

func (ghc *GitHubClient) ListOpenIssues(ctx context.Context) ([]models.Issue, error)

ListOpenIssues fetches currently open issues, most recently updated first, capped to a single page so a duplicate check stays cheap and fast.

func (*GitHubClient) SetMainPath added in v1.7.0

func (ghc *GitHubClient) SetMainPath(path string)

func (*GitHubClient) UpdatePR

func (ghc *GitHubClient) UpdatePR(ctx context.Context, prNumber int, summary models.PRSummary) error

func (*GitHubClient) UpdateRelease

func (ghc *GitHubClient) UpdateRelease(ctx context.Context, version, body string) error

type IssuesService

type IssuesService interface {
	ListLabels(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.Label, *github.Response, error)
	CreateLabel(ctx context.Context, owner, repo string, label *github.Label) (*github.Label, *github.Response, error)
	AddLabelsToIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*github.Label, *github.Response, error)
	ListByRepo(ctx context.Context, owner, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error)
	Get(ctx context.Context, owner, repo string, number int) (*github.Issue, *github.Response, error)
	Edit(ctx context.Context, owner, repo string, number int, issue *github.IssueRequest) (*github.Issue, *github.Response, error)
	Create(ctx context.Context, owner, repo string, issue *github.IssueRequest) (*github.Issue, *github.Response, error) // ← NEW
}

type PullRequestsService

type PullRequestsService interface {
	Edit(ctx context.Context, owner, repo string, number int, pr *github.PullRequest) (*github.PullRequest, *github.Response, error)
	List(ctx context.Context, owner, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
	Get(ctx context.Context, owner, repo string, number int) (*github.PullRequest, *github.Response, error)
	ListCommits(ctx context.Context, owner, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)
	GetRaw(ctx context.Context, owner, repo string, number int, opts github.RawOptions) (string, *github.Response, error)
}

type ReleasesService

type ReleasesService interface {
	CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
	GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*github.RepositoryRelease, *github.Response, error)
	EditRelease(ctx context.Context, owner, repo string, id int64, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
	UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opt *github.UploadOptions, file *os.File) (*github.ReleaseAsset, *github.Response, error)
}

type RepositoriesService

type RepositoriesService interface {
	GetCommit(ctx context.Context, owner, repo, sha string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)
	CompareCommits(ctx context.Context, owner, repo, base, head string, opts *github.ListOptions) (*github.CommitsComparison, *github.Response, error)
	GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
}

type UsersService

type UsersService interface {
	Get(ctx context.Context, user string) (*github.User, *github.Response, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL