Documentation
¶
Index ¶
Constants ¶
View Source
const Provider = "github"
Variables ¶
View Source
var ( // ErrGitHubAPI signals an error while making a request to the GitHub API. ErrGitHubAPI = errors.NewKind("github api error") // ErrEventNotSupported signals that this provider does not support the // given event for a given operation. ErrEventNotSupported = errors.NewKind("event not supported") )
View Source
var ( NoErrNotModified = errors.NewKind("Not modified") ErrParsingEventPayload = errors.NewKind("Parse error in event") // RequestTimeout is the max time to wait until the request context is // cancelled. RequestTimeout = time.Second * 5 )
View Source
var (
ErrLineOutOfDiff = errors.NewKind("line number is not in diff")
)
Functions ¶
This section is empty.
Types ¶
type CommitsComparator ¶
type CommitsComparator interface { // CompareCommits compare two commits. CompareCommits(ctx context.Context, owner, repo string, base, head string) ( *github.CommitsComparison, *github.Response, error) }
CommitsComparator compares commits on GitHub. *github.RepositoriesService fulfills this interface.
type Poster ¶
type Poster struct {
// contains filtered or unexported fields
}
Poster posts comments as Pull Request Reviews.
func NewPoster ¶
func NewPoster(t http.RoundTripper, conf ProviderConfig) *Poster
NewPoster creates a new poster for the GitHub API.
func (*Poster) Post ¶
func (p *Poster) Post(ctx context.Context, e lookout.Event, aCommentsList []lookout.AnalyzerComments) error
Post posts comments as a Pull Request Review. If the event is not a GitHub Pull Request, ErrEventNotSupported is returned. If a GitHub API request fails, ErrGitHubAPI is returned.
type ProviderConfig ¶ added in v0.0.4
type ProviderConfig struct {
}ProviderConfig represents the yml config
type ReviewCreator ¶
type ReviewCreator interface { // CreateReview creates a new code review on a GitHub pull request. CreateReview(ctx context.Context, owner, repo string, number int, review *github.PullRequestReviewRequest) ( *github.PullRequestReview, *github.Response, error) }
ReviewCreator can create code reviews on GitHub. *github.PullRequestsService fulfills this interface.
type StatusCreator ¶ added in v0.0.3
type StatusCreator interface { // CreateStatus creates a new status for a repository at the specified // reference. Ref can be a SHA, a branch name, or a tag name. CreateStatus(ctx context.Context, owner, repo, ref string, status *github.RepoStatus) ( *github.RepoStatus, *github.Response, error) }
StatusCreator creates statuses on GitHub. *github.RepositoriesService fulfills this interface.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher(transport http.RoundTripper, o *lookout.WatchOptions) (*Watcher, error)
NewWatcher returns a new
Click to show internal directories.
Click to hide internal directories.