Documentation
¶
Index ¶
Constants ¶
const Provider = "github"
Variables ¶
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") )
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 )
var (
ErrLineOutOfDiff = errors.NewKind("line number is not in diff")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.1.0
Client is a wrapper for github.Client that supports cache and provides rate limit information
func NewClient ¶ added in v0.1.0
func NewClient(t http.RoundTripper, cache *cache.ValidableCache, l log.Logger) *Client
NewClient creates new Client
func (*Client) PollInterval ¶ added in v0.1.0
PollInterval returns last duration from X-Poll-Interval for a client by category
type ClientPool ¶ added in v0.1.0
type ClientPool struct {
// contains filtered or unexported fields
}
ClientPool holds mapping of repositories to clients
func NewClientPoolFromTokens ¶ added in v0.1.0
func NewClientPoolFromTokens(urls map[string]UserToken, defaultToken UserToken, cache *cache.ValidableCache) (*ClientPool, error)
NewClientPoolFromTokens creates new ClientPool based on map[repoURL]UserToken later we will need another constructor that would request installations and create pool from it
func (*ClientPool) Client ¶ added in v0.1.0
func (p *ClientPool) Client(username, repo string) (*Client, bool)
Client returns client, ok by username and repository name
func (*ClientPool) Clients ¶ added in v0.1.0
func (p *ClientPool) Clients() map[*Client][]*lookout.RepositoryInfo
Clients returns map[Client]RepositoryInfo
type Poster ¶
type Poster struct {
// contains filtered or unexported fields
}
Poster posts comments as Pull Request Reviews.
func NewPoster ¶
func NewPoster(pool *ClientPool, 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 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(pool *ClientPool, o *lookout.WatchOptions) (*Watcher, error)
NewWatcher returns a new