ghapi

package
v0.0.0-...-796c538 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DEFAULT_QUERY is a default github search query that will be used to
	// fetch github repositories
	DEFAULT_QUERY = "stars:>=1000"
)

Variables

This section is empty.

Functions

func AuthenticatedClient

func AuthenticatedClient(token string) *github.Client

AuthenticatedClient creates authenticated github client with provided token.

func FetchQueriedRepositories

func FetchQueriedRepositories(
	githubClient *github.Client,
	page, perPage int,
	query string) (repositories []neo.Resource, err error)

FetchQueriedRepositories will download repositories by the gived query.

Types

type IssueCommentsService

type IssueCommentsService struct {
	// contains filtered or unexported fields
}

IssueCommentsService is responsible for mapping github.IssueComment to mode.IssueComment

func (IssueCommentsService) Fetch

func (ics IssueCommentsService) Fetch(repo model.Repository, pullRequestID, requesterID int64) (issueComments []neo.Resource, err error)

Fetch will download PullRequest IssueComment

type PRCommentsService

type PRCommentsService struct {
	// contains filtered or unexported fields
}

PRCommentsService is responsible for mapping github.PullRequestComment to model.PullRequestComment

func (PRCommentsService) Fetch

func (prcs PRCommentsService) Fetch(repo model.Repository, pullRequestID, requesterID int64) (prComments []neo.Resource, err error)

Fetch will download PullRequest Comment

type PullRequestService

type PullRequestService interface {
	Fetch(repo model.Repository, pullRequestID, requesterID int64) ([]neo.Resource, error)
}

PullRequestService represents PullRequest related GitHub resource

func PullRequestServices

func PullRequestServices(githubClient *github.Client, weights PullRequestServicesWeights) []PullRequestService

PullRequestServices returns list of supported Pull Request Services

type PullRequestServicesWeights

type PullRequestServicesWeights struct {
	ReviewersWeight, IssueCommentsWeight, PRCommentsWeight int64
}

PullRequestServicesWeights represents PullRequest-related services weight configuration.

type RepoResource

type RepoResource interface {
	FetchRepoResource(model.Repository) ([]neo.Resource, error)
}

RepoResource represents repository related GitHub resource

type RequestersService

type RequestersService struct {
	GithubClient *github.Client
}

RequestersService is responsible for mapping github.PullRequest.User to model.Requester

func (RequestersService) FetchRepoResource

func (rs RequestersService) FetchRepoResource(repo model.Repository) (requesters []neo.Resource, err error)

FetchRepoResource will download PullRequest Authors

type ReviewersService

type ReviewersService struct {
	// contains filtered or unexported fields
}

ReviewersService is responsible for mapping github.Reviewer.User to model.Reviewer

func (ReviewersService) Fetch

func (rs ReviewersService) Fetch(repo model.Repository, pullRequestID, requesterID int64) (reviewers []neo.Resource, err error)

Fetch will download Review Authors

Jump to

Keyboard shortcuts

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