Documentation
¶
Overview ¶
Package platform defines interfaces for interacting with code review platforms.
Index ¶
Constants ¶
View Source
const ( TypeUnspecified = "" TypeGitHub = "github" TypeGitLab = "gitlab" )
Variables ¶
View Source
var ( // SortedTypes are the sorted Platform types for printing messages and prediction. SortedTypes = func() []string { allowed := append([]string{}, TypeGitHub, TypeGitLab) sort.Strings(allowed) return allowed }() )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Type string GitHub gitHubConfig GitLab gitLabConfig }
Config is the configuration needed to generate different Platform types.
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
GitHub implements the Platform interface.
func (*GitHub) GetIssueBody ¶
GetIssueBody gets the Issue body.
type GitLab ¶
type GitLab struct {
// contains filtered or unexported fields
}
GitLab implements the Platform interface.
func (*GitLab) GetIssueBody ¶
GetIssueBody gets the body of the issue.
type MockPlatform ¶
type MockPlatform struct { Reqs []*Request IsPullRequest bool IncludeTeams bool GetRequestBodyErr error GetRequestBodyResponse string GetIssueBodyErr error GetIssueBodyResponse string // contains filtered or unexported fields }
func (*MockPlatform) GetIssueBody ¶
func (m *MockPlatform) GetIssueBody(ctx context.Context) (string, error)
func (*MockPlatform) GetRequestBody ¶
func (m *MockPlatform) GetRequestBody(ctx context.Context) (string, error)
type Platform ¶
type Platform interface { // GetRequestBody gets the Pull Request or Merge Request body. GetRequestBody(ctx context.Context) (string, error) // GetIssueBody gets the body of the issue. GetIssueBody(ctx context.Context) (string, error) }
Platform defines the minimum interface for a code review platform.
Click to show internal directories.
Click to hide internal directories.