Documentation
¶
Index ¶
- type GhCli
- func (c *GhCli) CreatePR(ctx context.Context, p NewPR) (PullRequest, error)
- func (c *GhCli) CurrentUser(_ context.Context) (string, error)
- func (c *GhCli) GetPR(_ context.Context, number int) (PullRequest, error)
- func (c *GhCli) ListMergedPRsByHead(_ context.Context, heads []string) ([]PullRequest, error)
- func (c *GhCli) ListOpenPRs(_ context.Context) ([]PullRequest, error)
- func (c *GhCli) UpdatePRBase(_ context.Context, number int, newBase string) error
- func (c *GhCli) UpdatePRBody(_ context.Context, number int, body string) error
- type GitHubClient
- type MockGhClient
- func (m *MockGhClient) CreatePR(_ context.Context, p NewPR) (PullRequest, error)
- func (m *MockGhClient) CurrentUser(_ context.Context) (string, error)
- func (m *MockGhClient) GetPR(_ context.Context, number int) (PullRequest, error)
- func (m *MockGhClient) ListMergedPRsByHead(_ context.Context, heads []string) ([]PullRequest, error)
- func (m *MockGhClient) ListOpenPRs(_ context.Context) ([]PullRequest, error)
- func (m *MockGhClient) SetState(number int, state string)
- func (m *MockGhClient) UpdatePRBase(_ context.Context, number int, newBase string) error
- func (m *MockGhClient) UpdatePRBody(_ context.Context, number int, body string) error
- type NewPR
- type PullRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GhCli ¶
type GhCli struct {
// contains filtered or unexported fields
}
func (*GhCli) ListMergedPRsByHead ¶
func (*GhCli) ListOpenPRs ¶
func (c *GhCli) ListOpenPRs(_ context.Context) ([]PullRequest, error)
func (*GhCli) UpdatePRBase ¶
type GitHubClient ¶
type GitHubClient interface {
CurrentUser(ctx context.Context) (string, error)
ListOpenPRs(ctx context.Context) ([]PullRequest, error)
// ListMergedPRsByHead returns at most one merged PR per head (the most recent
// by number when there are duplicates). Heads that have no merged PR are
// simply absent from the result. Used by sync's squash-merged-parent detection.
ListMergedPRsByHead(ctx context.Context, heads []string) ([]PullRequest, error)
GetPR(ctx context.Context, number int) (PullRequest, error)
CreatePR(ctx context.Context, p NewPR) (PullRequest, error)
UpdatePRBody(ctx context.Context, number int, body string) error
UpdatePRBase(ctx context.Context, number int, newBase string) error
}
type MockGhClient ¶
type MockGhClient struct {
User string
PRs map[int]PullRequest
NextNum int
Calls []string
}
func NewMock ¶
func NewMock() *MockGhClient
func (*MockGhClient) CreatePR ¶
func (m *MockGhClient) CreatePR(_ context.Context, p NewPR) (PullRequest, error)
func (*MockGhClient) CurrentUser ¶
func (m *MockGhClient) CurrentUser(_ context.Context) (string, error)
func (*MockGhClient) GetPR ¶
func (m *MockGhClient) GetPR(_ context.Context, number int) (PullRequest, error)
func (*MockGhClient) ListMergedPRsByHead ¶
func (m *MockGhClient) ListMergedPRsByHead(_ context.Context, heads []string) ([]PullRequest, error)
func (*MockGhClient) ListOpenPRs ¶
func (m *MockGhClient) ListOpenPRs(_ context.Context) ([]PullRequest, error)
func (*MockGhClient) SetState ¶
func (m *MockGhClient) SetState(number int, state string)
func (*MockGhClient) UpdatePRBase ¶
func (*MockGhClient) UpdatePRBody ¶
Click to show internal directories.
Click to hide internal directories.