github

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 10 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, trans *i18n.Translations) *GitHubClient

func NewGitHubClientWithServices

func NewGitHubClientWithServices(
	prService PullRequestsService,
	issuesService IssuesService,
	repoService RepositoriesService,
	releaseService ReleasesService,
	owner string,
	repo string,
	trans *i18n.Translations,
) *GitHubClient

func (*GitHubClient) AddLabelsToPR

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

func (*GitHubClient) CreateLabel

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

func (*GitHubClient) CreateRelease added in v1.3.0

func (ghc *GitHubClient) CreateRelease(ctx context.Context, release *models.Release, notes *models.ReleaseNotes, draft bool) error

func (*GitHubClient) GetPR

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

func (*GitHubClient) GetRepoLabels

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

func (*GitHubClient) UpdatePR

func (ghc *GitHubClient) UpdatePR(ctx context.Context, prNumber int, summary models.PRSummary) 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)
}

type MockIssuesService

type MockIssuesService struct {
	mock.Mock
}

func (*MockIssuesService) AddLabelsToIssue

func (m *MockIssuesService) AddLabelsToIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*github.Label, *github.Response, error)

func (*MockIssuesService) CreateLabel

func (m *MockIssuesService) CreateLabel(ctx context.Context, owner, repo string, label *github.Label) (*github.Label, *github.Response, error)

func (*MockIssuesService) ListLabels

func (m *MockIssuesService) ListLabels(ctx context.Context, owner, repo string, opts *github.ListOptions) ([]*github.Label, *github.Response, error)

type MockPRService

type MockPRService struct {
	mock.Mock
}

func (*MockPRService) Edit

func (m *MockPRService) Edit(ctx context.Context, owner, repo string, number int, pr *github.PullRequest) (*github.PullRequest, *github.Response, error)

func (*MockPRService) Get

func (m *MockPRService) Get(ctx context.Context, owner, repo string, number int) (*github.PullRequest, *github.Response, error)

func (*MockPRService) GetRaw

func (m *MockPRService) GetRaw(ctx context.Context, owner, repo string, number int, opts github.RawOptions) (string, *github.Response, error)

func (*MockPRService) ListCommits

func (m *MockPRService) ListCommits(ctx context.Context, owner, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)

type MockReleaseService added in v1.3.0

type MockReleaseService struct {
	mock.Mock
}

func (*MockReleaseService) CreateRelease added in v1.3.0

func (m *MockReleaseService) CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)

type MockRepoService added in v1.3.0

type MockRepoService struct {
	mock.Mock
}

func (*MockRepoService) GetCommit added in v1.3.0

func (m *MockRepoService) GetCommit(ctx context.Context, owner, repo, sha string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)

type PullRequestsService

type PullRequestsService interface {
	Edit(ctx context.Context, owner, repo string, number int, pr *github.PullRequest) (*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 added in v1.3.0

type ReleasesService interface {
	CreateRelease(ctx context.Context, owner, repo string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
}

type RepositoriesService added in v1.3.0

type RepositoriesService interface {
	GetCommit(ctx context.Context, owner, repo, sha string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)
}

Jump to

Keyboard shortcuts

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