github

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: AGPL-3.0 Imports: 16 Imported by: 4

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) *Poster

NewPoster creates a new poster for the GitHub API.

func (*Poster) Post

func (p *Poster) Post(ctx context.Context, e lookout.Event,
	cs []*lookout.Comment) 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 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 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

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context, cb lookout.EventHandler) error

Watch start to make request to the GitHub API and return the new events.

Jump to

Keyboard shortcuts

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