Documentation ¶
Index ¶
- func CommitsPage(qc QueryContext, repo Repo, branchName string, queryParams string) (pi PageInfo, res []CommitAuthor, rerr error)
- func EnterpriseVersion(qc QueryContext, apiURL string) (version string, rerr error)
- func PREditBody(qc QueryContext, id, body string) error
- func PREditTitle(qc QueryContext, id, title string) error
- func PaginateCommits(lastProcessed time.Time, fn PaginateCommitsFn) error
- func PaginateNewerThan(lastProcessed time.Time, fn PaginateNewerThanFn) error
- func PaginateRegular(fn PaginateRegularFn) error
- func PaginateRegularWithPageSize(pageSize int, fn PaginateRegularFn) error
- func PaginateV3(fn PaginateV3Fn) error
- func PullRequestComment(qc QueryContext, commentNodeID string) (res *sourcecode.PullRequestComment, rerr error)
- func PullRequestsPage(qc QueryContext, repoRefID string, queryParams string, ...) (pi PageInfo, res []PullRequest, totalCount int, rerr error)
- func ReposAll(qc QueryContext, org Org, res chan []Repo) error
- func ReposForOnboardAll(qc QueryContext, org Org) (res []*agent.RepoResponseRepos, _ error)
- func ReposPageInternal(qc QueryContext, org Org, queryParams string) (pi PageInfo, repos []Repo, _ error)
- func TokenScopes(qc QueryContext) (scopes []string, rerr error)
- func User(qc QueryContext, login string, orgMember bool) (user *sourcecode.User, _ error)
- func UsersAll(qc QueryContext, org Org, resChan chan []*sourcecode.User) error
- func UsersEnterpriseAll(qc QueryContext, resChan chan []*sourcecode.User) error
- type CommitAuthor
- type IDs
- type Org
- type PageInfo
- func PullRequestCommentsPage(qc QueryContext, pullRequestRefID string, queryParams string) (pi PageInfo, res []*sourcecode.PullRequestComment, totalCount int, rerr error)
- func PullRequestCommitsPage(qc QueryContext, pullRequestRefID string, queryParams string) (pi PageInfo, res []*sourcecode.PullRequestCommit, rerr error)
- func PullRequestReviewTimelineItemsPage(qc QueryContext, repo Repo, pullRequestRefID string, queryParams string) (pi PageInfo, res []*sourcecode.PullRequestReview, totalCount int, rerr error)
- func ReposForOnboardPage(qc QueryContext, org Org, queryParams string, stopOnUpdatedAt time.Time) (pi PageInfo, repos []*agent.RepoResponseRepos, _ error)
- func ReposPage(qc QueryContext, org Org, queryParams string, stopOnUpdatedAt time.Time) (pi PageInfo, repos []*sourcecode.Repo, totalCount int, rerr error)
- func UsersEnterprisePage(qc QueryContext, queryParams string) (pi PageInfo, users []*sourcecode.User, _ error)
- func UsersPage(qc QueryContext, org Org, queryParams string) (pi PageInfo, users []*sourcecode.User, _ error)
- type PaginateCommitsFn
- type PaginateNewerThanFn
- type PaginateRegularFn
- type PaginateV3Fn
- type PullRequest
- type QueryContext
- func (s QueryContext) BranchID(repoID, branchName, firstCommitSHA string) string
- func (s QueryContext) PullRequestID(repoID, refID string) string
- func (s QueryContext) RepoID(refID string) string
- func (s QueryContext) UserID(refID string) string
- func (s QueryContext) WithLogger(logger hclog.Logger) QueryContext
- type Repo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitsPage ¶
func CommitsPage( qc QueryContext, repo Repo, branchName string, queryParams string) (pi PageInfo, res []CommitAuthor, rerr error)
func EnterpriseVersion ¶
func EnterpriseVersion(qc QueryContext, apiURL string) (version string, rerr error)
EnterpriseVersion returns the major version of enterprise install. Since there is not endpoint for getting the actual version, we rely on the fact that when you make an unauthenticated request the api return link to docs with version in the url.
func PREditBody ¶
func PREditBody(qc QueryContext, id, body string) error
func PREditTitle ¶
func PREditTitle(qc QueryContext, id, title string) error
func PaginateCommits ¶
func PaginateCommits(lastProcessed time.Time, fn PaginateCommitsFn) error
PaginateCommits is pagination for commit history which supports since argument.
func PaginateNewerThan ¶
func PaginateNewerThan(lastProcessed time.Time, fn PaginateNewerThanFn) error
PaginateNewerThan is pagination for resources supporting orderBy UPDATED_AT field.
func PaginateRegular ¶
func PaginateRegular(fn PaginateRegularFn) error
func PaginateRegularWithPageSize ¶
func PaginateRegularWithPageSize(pageSize int, fn PaginateRegularFn) error
func PaginateV3 ¶
func PaginateV3(fn PaginateV3Fn) error
func PullRequestComment ¶
func PullRequestComment(qc QueryContext, commentNodeID string) (res *sourcecode.PullRequestComment, rerr error)
func PullRequestsPage ¶
func PullRequestsPage( qc QueryContext, repoRefID string, queryParams string, stopOnUpdatedAt time.Time) (pi PageInfo, res []PullRequest, totalCount int, rerr error)
func ReposForOnboardAll ¶
func ReposForOnboardAll(qc QueryContext, org Org) (res []*agent.RepoResponseRepos, _ error)
func ReposPageInternal ¶
func TokenScopes ¶
func TokenScopes(qc QueryContext) (scopes []string, rerr error)
func User ¶
func User(qc QueryContext, login string, orgMember bool) ( user *sourcecode.User, _ error)
func UsersAll ¶
func UsersAll(qc QueryContext, org Org, resChan chan []*sourcecode.User) error
func UsersEnterpriseAll ¶
func UsersEnterpriseAll(qc QueryContext, resChan chan []*sourcecode.User) error
Types ¶
type CommitAuthor ¶
type Org ¶
type Org struct {
Login string
}
Org contains the data needed for exporting other resources depending on it
func OrgsAll ¶
func OrgsAll(qc QueryContext) (res []Org, rerr error)
func OrgsEnterpriseAll ¶
func OrgsEnterpriseAll(qc QueryContext) (res []Org, rerr error)
func OrgsEnterprisePage ¶
type PageInfo ¶
type PageInfo struct { HasNextPage bool `json:"hasNextPage"` EndCursor string `json:"endCursor"` HasPreviousPage bool `json:"hasPreviousPage"` StartCursor string `json:"startCursor"` }
func PullRequestCommentsPage ¶
func PullRequestCommentsPage( qc QueryContext, pullRequestRefID string, queryParams string) (pi PageInfo, res []*sourcecode.PullRequestComment, totalCount int, rerr error)
func PullRequestCommitsPage ¶
func PullRequestCommitsPage( qc QueryContext, pullRequestRefID string, queryParams string) (pi PageInfo, res []*sourcecode.PullRequestCommit, rerr error)
func PullRequestReviewTimelineItemsPage ¶
func PullRequestReviewTimelineItemsPage( qc QueryContext, repo Repo, pullRequestRefID string, queryParams string) (pi PageInfo, res []*sourcecode.PullRequestReview, totalCount int, rerr error)
func ReposForOnboardPage ¶
func ReposForOnboardPage(qc QueryContext, org Org, queryParams string, stopOnUpdatedAt time.Time) (pi PageInfo, repos []*agent.RepoResponseRepos, _ error)
func ReposPage ¶
func ReposPage(qc QueryContext, org Org, queryParams string, stopOnUpdatedAt time.Time) (pi PageInfo, repos []*sourcecode.Repo, totalCount int, rerr error)
func UsersEnterprisePage ¶
func UsersEnterprisePage(qc QueryContext, queryParams string) (pi PageInfo, users []*sourcecode.User, _ error)
func UsersPage ¶
func UsersPage(qc QueryContext, org Org, queryParams string) (pi PageInfo, users []*sourcecode.User, _ error)
type PaginateCommitsFn ¶
type PaginateNewerThanFn ¶
type PaginateRegularFn ¶
type PullRequest ¶
type PullRequest struct { *sourcecode.PullRequest HasComments bool HasReviews bool LastCommitSHA string }
func PullRequestByID ¶
func PullRequestByID(qc QueryContext, refID string) (_ PullRequest, rerr error)
type QueryContext ¶
type QueryContext struct { Logger hclog.Logger Request func(query string, vars map[string]interface{}, res interface{}) error APIURL string APIURL3 string CustomerID string RefType string UserLoginToRefID func(login string) (refID string, _ error) UserLoginToRefIDFromCommit func(logger hclog.Logger, login, name, email string) (refID string, _ error) IsEnterprise func() bool Clients reqstats.Clients AuthToken string }
func (QueryContext) BranchID ¶
func (s QueryContext) BranchID(repoID, branchName, firstCommitSHA string) string
func (QueryContext) PullRequestID ¶
func (s QueryContext) PullRequestID(repoID, refID string) string
func (QueryContext) RepoID ¶
func (s QueryContext) RepoID(refID string) string
func (QueryContext) UserID ¶
func (s QueryContext) UserID(refID string) string
func (QueryContext) WithLogger ¶
func (s QueryContext) WithLogger(logger hclog.Logger) QueryContext
type Repo ¶
type Repo struct { ID string NameWithOwner string // DefaultBranch of the repo, could be empty if no commits yet. Used for getting commit_users DefaultBranch string }
Repo contains the data needed for exporting other resources depending on it
func ReposAllSlice ¶
func ReposAllSlice(qc QueryContext, org Org) (sl []Repo, rerr error)
Click to show internal directories.
Click to hide internal directories.