githubscraper

package
v0.0.0-...-7513c8a Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeStr is the value of "type" key in configuration.
	TypeStr = "github"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchNode

type BranchNode struct {
	// The ref name.
	Name string `json:"name"`
	// Compares the current ref as a base ref to another head ref, if the comparison can be made.
	Compare BranchNodeCompareComparison `json:"compare"`
	// The repository the ref belongs to.
	Repository BranchNodeRepository `json:"repository"`
}

BranchNode includes the requested fields of the GraphQL type Ref. The GraphQL type's documentation follows.

Represents a Git reference.

func (*BranchNode) GetCompare

func (v *BranchNode) GetCompare() BranchNodeCompareComparison

GetCompare returns BranchNode.Compare, and is useful for accessing the field via an interface.

func (*BranchNode) GetName

func (v *BranchNode) GetName() string

GetName returns BranchNode.Name, and is useful for accessing the field via an interface.

func (*BranchNode) GetRepository

func (v *BranchNode) GetRepository() BranchNodeRepository

GetRepository returns BranchNode.Repository, and is useful for accessing the field via an interface.

type BranchNodeCompareComparison

type BranchNodeCompareComparison struct {
	// The number of commits ahead of the base branch.
	AheadBy int `json:"aheadBy"`
	// The number of commits behind the base branch.
	BehindBy int `json:"behindBy"`
}

BranchNodeCompareComparison includes the requested fields of the GraphQL type Comparison. The GraphQL type's documentation follows.

Represents a comparison between two commit revisions.

func (*BranchNodeCompareComparison) GetAheadBy

func (v *BranchNodeCompareComparison) GetAheadBy() int

GetAheadBy returns BranchNodeCompareComparison.AheadBy, and is useful for accessing the field via an interface.

func (*BranchNodeCompareComparison) GetBehindBy

func (v *BranchNodeCompareComparison) GetBehindBy() int

GetBehindBy returns BranchNodeCompareComparison.BehindBy, and is useful for accessing the field via an interface.

type BranchNodeRepository

type BranchNodeRepository struct {
	// The name of the repository.
	Name string `json:"name"`
	// The Ref associated with the repository's default branch.
	DefaultBranchRef BranchNodeRepositoryDefaultBranchRef `json:"defaultBranchRef"`
}

BranchNodeRepository includes the requested fields of the GraphQL type Repository. The GraphQL type's documentation follows.

A repository contains the content for a project.

func (*BranchNodeRepository) GetDefaultBranchRef

GetDefaultBranchRef returns BranchNodeRepository.DefaultBranchRef, and is useful for accessing the field via an interface.

func (*BranchNodeRepository) GetName

func (v *BranchNodeRepository) GetName() string

GetName returns BranchNodeRepository.Name, and is useful for accessing the field via an interface.

type BranchNodeRepositoryDefaultBranchRef

type BranchNodeRepositoryDefaultBranchRef struct {
	// The ref name.
	Name string `json:"name"`
}

BranchNodeRepositoryDefaultBranchRef includes the requested fields of the GraphQL type Ref. The GraphQL type's documentation follows.

Represents a Git reference.

func (*BranchNodeRepositoryDefaultBranchRef) GetName

GetName returns BranchNodeRepositoryDefaultBranchRef.Name, and is useful for accessing the field via an interface.

type CommitNode

type CommitNode struct {
	// The object the ref points to. Returns null when object does not exist.
	Target CommitNodeTargetGitObject `json:"-"`
}

CommitNode includes the requested fields of the GraphQL type Ref. The GraphQL type's documentation follows.

Represents a Git reference.

func (*CommitNode) GetTarget

func (v *CommitNode) GetTarget() CommitNodeTargetGitObject

GetTarget returns CommitNode.Target, and is useful for accessing the field via an interface.

func (*CommitNode) MarshalJSON

func (v *CommitNode) MarshalJSON() ([]byte, error)

func (*CommitNode) UnmarshalJSON

func (v *CommitNode) UnmarshalJSON(b []byte) error

type CommitNodeTargetBlob

type CommitNodeTargetBlob struct {
	Typename string `json:"__typename"`
}

CommitNodeTargetBlob includes the requested fields of the GraphQL type Blob. The GraphQL type's documentation follows.

Represents a Git blob.

func (*CommitNodeTargetBlob) GetTypename

func (v *CommitNodeTargetBlob) GetTypename() string

GetTypename returns CommitNodeTargetBlob.Typename, and is useful for accessing the field via an interface.

type CommitNodeTargetCommit

type CommitNodeTargetCommit struct {
	Typename string `json:"__typename"`
	Id       string `json:"id"`
	// The linear commit history starting from (and including) this commit, in the same order as `git log`.
	History CommitNodeTargetCommitHistoryCommitHistoryConnection `json:"history"`
}

CommitNodeTargetCommit includes the requested fields of the GraphQL type Commit. The GraphQL type's documentation follows.

Represents a Git commit.

func (*CommitNodeTargetCommit) GetHistory

GetHistory returns CommitNodeTargetCommit.History, and is useful for accessing the field via an interface.

func (*CommitNodeTargetCommit) GetId

func (v *CommitNodeTargetCommit) GetId() string

GetId returns CommitNodeTargetCommit.Id, and is useful for accessing the field via an interface.

func (*CommitNodeTargetCommit) GetTypename

func (v *CommitNodeTargetCommit) GetTypename() string

GetTypename returns CommitNodeTargetCommit.Typename, and is useful for accessing the field via an interface.

type CommitNodeTargetCommitHistoryCommitHistoryConnection

type CommitNodeTargetCommitHistoryCommitHistoryConnection struct {
	// A list of edges.
	Edges []CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdge `json:"edges"`
	// Information to aid in pagination.
	PageInfo CommitNodeTargetCommitHistoryCommitHistoryConnectionPageInfo `json:"pageInfo"`
}

CommitNodeTargetCommitHistoryCommitHistoryConnection includes the requested fields of the GraphQL type CommitHistoryConnection. The GraphQL type's documentation follows.

The connection type for Commit.

func (*CommitNodeTargetCommitHistoryCommitHistoryConnection) GetEdges

GetEdges returns CommitNodeTargetCommitHistoryCommitHistoryConnection.Edges, and is useful for accessing the field via an interface.

func (*CommitNodeTargetCommitHistoryCommitHistoryConnection) GetPageInfo

GetPageInfo returns CommitNodeTargetCommitHistoryCommitHistoryConnection.PageInfo, and is useful for accessing the field via an interface.

type CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdge

type CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdge struct {
	// The item at the end of the edge.
	Node CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit `json:"node"`
}

CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdge includes the requested fields of the GraphQL type CommitEdge. The GraphQL type's documentation follows.

An edge in a connection.

func (*CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdge) GetNode

GetNode returns CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdge.Node, and is useful for accessing the field via an interface.

type CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit

type CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit struct {
	// The datetime when this commit was committed.
	CommittedDate time.Time `json:"committedDate"`
	// The number of additions in this commit.
	Additions int `json:"additions"`
	// The number of deletions in this commit.
	Deletions int `json:"deletions"`
}

CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit includes the requested fields of the GraphQL type Commit. The GraphQL type's documentation follows.

Represents a Git commit.

func (*CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit) GetAdditions

GetAdditions returns CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit.Additions, and is useful for accessing the field via an interface.

func (*CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit) GetCommittedDate

GetCommittedDate returns CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit.CommittedDate, and is useful for accessing the field via an interface.

func (*CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit) GetDeletions

GetDeletions returns CommitNodeTargetCommitHistoryCommitHistoryConnectionEdgesCommitEdgeNodeCommit.Deletions, and is useful for accessing the field via an interface.

type CommitNodeTargetCommitHistoryCommitHistoryConnectionPageInfo

type CommitNodeTargetCommitHistoryCommitHistoryConnectionPageInfo struct {
	// When paginating forwards, the cursor to continue.
	EndCursor string `json:"endCursor"`
	// When paginating forwards, are there more items?
	HasNextPage bool `json:"hasNextPage"`
}

CommitNodeTargetCommitHistoryCommitHistoryConnectionPageInfo includes the requested fields of the GraphQL type PageInfo. The GraphQL type's documentation follows.

Information about pagination in a connection.

func (*CommitNodeTargetCommitHistoryCommitHistoryConnectionPageInfo) GetEndCursor

GetEndCursor returns CommitNodeTargetCommitHistoryCommitHistoryConnectionPageInfo.EndCursor, and is useful for accessing the field via an interface.

func (*CommitNodeTargetCommitHistoryCommitHistoryConnectionPageInfo) GetHasNextPage

GetHasNextPage returns CommitNodeTargetCommitHistoryCommitHistoryConnectionPageInfo.HasNextPage, and is useful for accessing the field via an interface.

type CommitNodeTargetGitObject

type CommitNodeTargetGitObject interface {

	// GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values).
	GetTypename() string
	// contains filtered or unexported methods
}

CommitNodeTargetGitObject includes the requested fields of the GraphQL interface GitObject.

CommitNodeTargetGitObject is implemented by the following types: CommitNodeTargetBlob CommitNodeTargetCommit CommitNodeTargetTag CommitNodeTargetTree The GraphQL type's documentation follows.

Represents a Git object.

type CommitNodeTargetTag

type CommitNodeTargetTag struct {
	Typename string `json:"__typename"`
}

CommitNodeTargetTag includes the requested fields of the GraphQL type Tag. The GraphQL type's documentation follows.

Represents a Git tag.

func (*CommitNodeTargetTag) GetTypename

func (v *CommitNodeTargetTag) GetTypename() string

GetTypename returns CommitNodeTargetTag.Typename, and is useful for accessing the field via an interface.

type CommitNodeTargetTree

type CommitNodeTargetTree struct {
	Typename string `json:"__typename"`
}

CommitNodeTargetTree includes the requested fields of the GraphQL type Tree. The GraphQL type's documentation follows.

Represents a Git tree.

func (*CommitNodeTargetTree) GetTypename

func (v *CommitNodeTargetTree) GetTypename() string

GetTypename returns CommitNodeTargetTree.Typename, and is useful for accessing the field via an interface.

type Config

type Config struct {
	metadata.MetricsBuilderConfig `mapstructure:",squash"`
	confighttp.ClientConfig       `mapstructure:",squash"`
	internal.ScraperConfig
	// GitHubOrg is the name of the GitHub organization to scrape
	GitHubOrg string `mapstructure:"github_org"`
	// SearchQuery is the query to use when defining a custom search for repository data
	SearchQuery string `mapstructure:"search_query"`
}

Config relating to Github Metric Scraper.

type Factory

type Factory struct{}

func (*Factory) CreateDefaultConfig

func (f *Factory) CreateDefaultConfig() internal.Config

func (*Factory) CreateMetricsScraper

func (f *Factory) CreateMetricsScraper(
	ctx context.Context,
	params receiver.CreateSettings,
	cfg internal.Config,
) (scraperhelper.Scraper, error)

type PullRequestNode

type PullRequestNode struct {
	// Identifies the date and time when the object was created.
	CreatedAt time.Time `json:"createdAt"`
	// Whether or not the pull request was merged.
	Merged bool `json:"merged"`
	// The date and time that the pull request was merged.
	MergedAt time.Time `json:"mergedAt"`
	// The commit that was created when this pull request was merged.
	MergeCommit PullRequestNodeMergeCommit `json:"mergeCommit"`
	// Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted.
	HeadRefName string `json:"headRefName"`
	// A list of reviews associated with the pull request.
	Reviews PullRequestNodeReviewsPullRequestReviewConnection `json:"reviews"`
}

PullRequestNode includes the requested fields of the GraphQL type PullRequest. The GraphQL type's documentation follows.

A repository pull request.

func (*PullRequestNode) GetCreatedAt

func (v *PullRequestNode) GetCreatedAt() time.Time

GetCreatedAt returns PullRequestNode.CreatedAt, and is useful for accessing the field via an interface.

func (*PullRequestNode) GetHeadRefName

func (v *PullRequestNode) GetHeadRefName() string

GetHeadRefName returns PullRequestNode.HeadRefName, and is useful for accessing the field via an interface.

func (*PullRequestNode) GetMergeCommit

func (v *PullRequestNode) GetMergeCommit() PullRequestNodeMergeCommit

GetMergeCommit returns PullRequestNode.MergeCommit, and is useful for accessing the field via an interface.

func (*PullRequestNode) GetMerged

func (v *PullRequestNode) GetMerged() bool

GetMerged returns PullRequestNode.Merged, and is useful for accessing the field via an interface.

func (*PullRequestNode) GetMergedAt

func (v *PullRequestNode) GetMergedAt() time.Time

GetMergedAt returns PullRequestNode.MergedAt, and is useful for accessing the field via an interface.

func (*PullRequestNode) GetReviews

GetReviews returns PullRequestNode.Reviews, and is useful for accessing the field via an interface.

type PullRequestNodeMergeCommit

type PullRequestNodeMergeCommit struct {
	// The deployments associated with a commit.
	Deployments PullRequestNodeMergeCommitDeploymentsDeploymentConnection `json:"deployments"`
}

PullRequestNodeMergeCommit includes the requested fields of the GraphQL type Commit. The GraphQL type's documentation follows.

Represents a Git commit.

func (*PullRequestNodeMergeCommit) GetDeployments

GetDeployments returns PullRequestNodeMergeCommit.Deployments, and is useful for accessing the field via an interface.

type PullRequestNodeMergeCommitDeploymentsDeploymentConnection

type PullRequestNodeMergeCommitDeploymentsDeploymentConnection struct {
	// A list of nodes.
	Nodes []PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment `json:"nodes"`
	// Identifies the total count of items in the connection.
	TotalCount int `json:"totalCount"`
}

PullRequestNodeMergeCommitDeploymentsDeploymentConnection includes the requested fields of the GraphQL type DeploymentConnection. The GraphQL type's documentation follows.

The connection type for Deployment.

func (*PullRequestNodeMergeCommitDeploymentsDeploymentConnection) GetNodes

GetNodes returns PullRequestNodeMergeCommitDeploymentsDeploymentConnection.Nodes, and is useful for accessing the field via an interface.

func (*PullRequestNodeMergeCommitDeploymentsDeploymentConnection) GetTotalCount

GetTotalCount returns PullRequestNodeMergeCommitDeploymentsDeploymentConnection.TotalCount, and is useful for accessing the field via an interface.

type PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment

type PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment struct {
	// Identifies the date and time when the object was created.
	CreatedAt time.Time `json:"createdAt"`
}

PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment includes the requested fields of the GraphQL type Deployment. The GraphQL type's documentation follows.

Represents triggered deployment instance.

func (*PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment) GetCreatedAt

GetCreatedAt returns PullRequestNodeMergeCommitDeploymentsDeploymentConnectionNodesDeployment.CreatedAt, and is useful for accessing the field via an interface.

type PullRequestNodeReviewsPullRequestReviewConnection

type PullRequestNodeReviewsPullRequestReviewConnection struct {
	// Identifies the total count of items in the connection.
	TotalCount int `json:"totalCount"`
	// A list of nodes.
	Nodes []PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview `json:"nodes"`
}

PullRequestNodeReviewsPullRequestReviewConnection includes the requested fields of the GraphQL type PullRequestReviewConnection. The GraphQL type's documentation follows.

The connection type for PullRequestReview.

func (*PullRequestNodeReviewsPullRequestReviewConnection) GetNodes

GetNodes returns PullRequestNodeReviewsPullRequestReviewConnection.Nodes, and is useful for accessing the field via an interface.

func (*PullRequestNodeReviewsPullRequestReviewConnection) GetTotalCount

GetTotalCount returns PullRequestNodeReviewsPullRequestReviewConnection.TotalCount, and is useful for accessing the field via an interface.

type PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview

type PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview struct {
	// Identifies the date and time when the object was created.
	CreatedAt time.Time `json:"createdAt"`
}

PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview includes the requested fields of the GraphQL type PullRequestReview. The GraphQL type's documentation follows.

A review object for a given pull request.

func (*PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview) GetCreatedAt

GetCreatedAt returns PullRequestNodeReviewsPullRequestReviewConnectionNodesPullRequestReview.CreatedAt, and is useful for accessing the field via an interface.

type PullRequestState

type PullRequestState string

The possible states of a pull request.

const (
	// A pull request that is still open.
	PullRequestStateOpen PullRequestState = "OPEN"
	// A pull request that has been closed without being merged.
	PullRequestStateClosed PullRequestState = "CLOSED"
	// A pull request that has been closed by being merged.
	PullRequestStateMerged PullRequestState = "MERGED"
)

type SearchNode

type SearchNode interface {

	// GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values).
	GetTypename() string
	// contains filtered or unexported methods
}

SearchNode includes the requested fields of the GraphQL interface SearchResultItem.

SearchNode is implemented by the following types: SearchNodeApp SearchNodeDiscussion SearchNodeIssue SearchNodeMarketplaceListing SearchNodeOrganization SearchNodePullRequest SearchNodeRepository SearchNodeUser The GraphQL type's documentation follows.

The results of a search.

type SearchNodeApp

type SearchNodeApp struct {
	Typename string `json:"__typename"`
}

SearchNodeApp includes the requested fields of the GraphQL type App. The GraphQL type's documentation follows.

A GitHub App.

func (*SearchNodeApp) GetTypename

func (v *SearchNodeApp) GetTypename() string

GetTypename returns SearchNodeApp.Typename, and is useful for accessing the field via an interface.

type SearchNodeDefaultBranchRef

type SearchNodeDefaultBranchRef struct {
	// The ref name.
	Name string `json:"name"`
}

SearchNodeDefaultBranchRef includes the requested fields of the GraphQL type Ref. The GraphQL type's documentation follows.

Represents a Git reference.

func (*SearchNodeDefaultBranchRef) GetName

func (v *SearchNodeDefaultBranchRef) GetName() string

GetName returns SearchNodeDefaultBranchRef.Name, and is useful for accessing the field via an interface.

type SearchNodeDiscussion

type SearchNodeDiscussion struct {
	Typename string `json:"__typename"`
}

SearchNodeDiscussion includes the requested fields of the GraphQL type Discussion. The GraphQL type's documentation follows.

A discussion in a repository.

func (*SearchNodeDiscussion) GetTypename

func (v *SearchNodeDiscussion) GetTypename() string

GetTypename returns SearchNodeDiscussion.Typename, and is useful for accessing the field via an interface.

type SearchNodeIssue

type SearchNodeIssue struct {
	Typename string `json:"__typename"`
}

SearchNodeIssue includes the requested fields of the GraphQL type Issue. The GraphQL type's documentation follows.

An Issue is a place to discuss ideas, enhancements, tasks, and bugs for a project.

func (*SearchNodeIssue) GetTypename

func (v *SearchNodeIssue) GetTypename() string

GetTypename returns SearchNodeIssue.Typename, and is useful for accessing the field via an interface.

type SearchNodeMarketplaceListing

type SearchNodeMarketplaceListing struct {
	Typename string `json:"__typename"`
}

SearchNodeMarketplaceListing includes the requested fields of the GraphQL type MarketplaceListing. The GraphQL type's documentation follows.

A listing in the GitHub integration marketplace.

func (*SearchNodeMarketplaceListing) GetTypename

func (v *SearchNodeMarketplaceListing) GetTypename() string

GetTypename returns SearchNodeMarketplaceListing.Typename, and is useful for accessing the field via an interface.

type SearchNodeOrganization

type SearchNodeOrganization struct {
	Typename string `json:"__typename"`
}

SearchNodeOrganization includes the requested fields of the GraphQL type Organization. The GraphQL type's documentation follows.

An account on GitHub, with one or more owners, that has repositories, members and teams.

func (*SearchNodeOrganization) GetTypename

func (v *SearchNodeOrganization) GetTypename() string

GetTypename returns SearchNodeOrganization.Typename, and is useful for accessing the field via an interface.

type SearchNodePullRequest

type SearchNodePullRequest struct {
	Typename string `json:"__typename"`
}

SearchNodePullRequest includes the requested fields of the GraphQL type PullRequest. The GraphQL type's documentation follows.

A repository pull request.

func (*SearchNodePullRequest) GetTypename

func (v *SearchNodePullRequest) GetTypename() string

GetTypename returns SearchNodePullRequest.Typename, and is useful for accessing the field via an interface.

type SearchNodeRepository

type SearchNodeRepository struct {
	Typename string `json:"__typename"`
	Id       string `json:"id"`
	// The name of the repository.
	Name string `json:"name"`
	// The Ref associated with the repository's default branch.
	DefaultBranchRef SearchNodeDefaultBranchRef `json:"defaultBranchRef"`
}

SearchNodeRepository includes the requested fields of the GraphQL type Repository. The GraphQL type's documentation follows.

A repository contains the content for a project.

func (*SearchNodeRepository) GetDefaultBranchRef

func (v *SearchNodeRepository) GetDefaultBranchRef() SearchNodeDefaultBranchRef

GetDefaultBranchRef returns SearchNodeRepository.DefaultBranchRef, and is useful for accessing the field via an interface.

func (*SearchNodeRepository) GetId

func (v *SearchNodeRepository) GetId() string

GetId returns SearchNodeRepository.Id, and is useful for accessing the field via an interface.

func (*SearchNodeRepository) GetName

func (v *SearchNodeRepository) GetName() string

GetName returns SearchNodeRepository.Name, and is useful for accessing the field via an interface.

func (*SearchNodeRepository) GetTypename

func (v *SearchNodeRepository) GetTypename() string

GetTypename returns SearchNodeRepository.Typename, and is useful for accessing the field via an interface.

type SearchNodeUser

type SearchNodeUser struct {
	Typename string `json:"__typename"`
}

SearchNodeUser includes the requested fields of the GraphQL type User. The GraphQL type's documentation follows.

A user is an individual's account on GitHub that owns repositories and can make new content.

func (*SearchNodeUser) GetTypename

func (v *SearchNodeUser) GetTypename() string

GetTypename returns SearchNodeUser.Typename, and is useful for accessing the field via an interface.

Jump to

Keyboard shortcuts

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