githubscraper

package
v0.116.0 Latest Latest
Warning

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

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

README

GitHub Limitations

API Limitations

The GitHub scraper is reliant on limitations found within GitHub's REST and GraphQL APIs. The following limitations are known:

  • The original creation date of a branch is not available via either of the APIs. GitSCM (the tool) does provide Ref creation time however this is not exposed. As such, we're forced to calculate the age by looking to see if any changes have been made to the branch, using that commit as the time from which we can grab the date. This means that age will reflect the time between now and the first commit on a new branch. It also means that we don't have ages for branches that have been created from trunk but have not had any changes made to them.
  • It's possible that some queries may run against a branch that has been deleted. This is unlikely due to the speed of the requests, however, possible.
  • Both APIs have primary and secondary rate limits applied to them. The default rate limit for GraphQL API is 5,000 points per hour when authenticated with a GitHub Personal Access Token (PAT). If using the GitHub App Auth extension then your rate limit increases to 10,000. The receiver on average costs 4 points per repository (which can heavily fluctuate), allowing it to scrape up to 1250 repositories per hour under normal conditions. You may use the following equation to roughly calculate your ideal collection interval.
\text{collection\_interval (seconds)} = \frac{4n}{r/3600}
\begin{aligned}
    \text{where:} \\
    n &= \text{number of repositories} \\
    r &= \text{hourly rate limit} \\
\end{aligned}

In addition to these primary rate limits, GitHub enforces secondary rate limits to prevent abuse and maintain API availability. The following secondary limit is particularly relevant:

  • Concurrent Requests Limit: The API allows no more than 100 concurrent requests. This limit is shared across the REST and GraphQL APIs. Since the scraper creates a goroutine per repository, having more than 100 repositories returned by the search_query will result in exceeding this limit. It is recommended to use the search_query config option to limit the number of repositories that are scraped. We recommend one instance of the receiver per team (note: team is not a valid quantifier when searching repositories topic is). Reminder that each instance of the receiver should have its own corresponding token for authentication as this is what rate limits are tied to.

In summary, we recommend the following:

  • One instance of the receiver per team
  • Each instance of the receiver should have its own token
  • Leverage search_query config option to limit repositories returned to 100 or less per instance
  • collection_interval should be long enough to avoid rate limiting (see above formula). A sensible default is 300s.

Additional Resources:

Branch Data Limitations

Due to the limitations of the GitHub GraphQL and REST APIs, some data retrieved may not be as expected. Notably there are spots in the code which link to this section that make decisions based on these limitations.

Queries are constructed to maximize performance without being overly complex. Note that there are sections in the code where BehindBy is being used in place of AheadBy and vice versa. This is a byproduct of the getBranchData query which returns all the refs (branches) from a given repository and the comparison to the default branch (trunk). Comparing it here reduces the need to make a query that gets all the names of the refs (branches), and then queries against each branch.

Another such byproduct of this method is the skipping of metric creation if the branch is the default branch (trunk) or if no changes have been made to the ref (branch). This is done for three main reasons.

  1. The default branch will always be a long-lived branch and may end up with more commits than can be possibly queried at a given time.
  2. The default is the trunk of which all changes should go into. The intent of these metrics is to provide useful signals helping identify cognitive overhead and bottlenecks.
  3. GitHub does not provide any means to determine when a branch was actually created. Git the tool however does provide a created time for each ref off the trunk. GitHub does not expose this data via their APIs and thus we have to calculate age based on commits added to the branch.

We also have to calculate the number of pages before getting the commit data. This is because you have to know the exact number of commits added to the branch, otherwise you'll get all commits from both trunk and the branch from all time. From there we can evaluate the commits on each branch. To calculate the time (age) of a branch, we have to know the commits that have been added to the branch because GitHub does not provide the actual created date of a branch through either of its APIs.

Documentation

Index

Constants

View Source
const (
	TypeStr = "scraper"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchHistory

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

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

Represents a Git reference.

func (*BranchHistory) GetTarget

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

func (*BranchHistory) MarshalJSON

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

func (*BranchHistory) UnmarshalJSON

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

type BranchHistoryTargetBlob

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

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

Represents a Git blob.

func (*BranchHistoryTargetBlob) GetTypename

func (v *BranchHistoryTargetBlob) GetTypename() string

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

type BranchHistoryTargetCommit

type BranchHistoryTargetCommit 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 BranchHistoryTargetCommitHistoryCommitHistoryConnection `json:"history"`
}

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

Represents a Git commit.

func (*BranchHistoryTargetCommit) GetHistory

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

func (*BranchHistoryTargetCommit) GetId

func (v *BranchHistoryTargetCommit) GetId() string

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

func (*BranchHistoryTargetCommit) GetTypename

func (v *BranchHistoryTargetCommit) GetTypename() string

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

type BranchHistoryTargetCommitHistoryCommitHistoryConnection

type BranchHistoryTargetCommitHistoryCommitHistoryConnection struct {
	// A list of nodes.
	Nodes []CommitNode `json:"nodes"`
	// Information to aid in pagination.
	PageInfo BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo `json:"pageInfo"`
}

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

The connection type for Commit.

func (*BranchHistoryTargetCommitHistoryCommitHistoryConnection) GetNodes

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

func (*BranchHistoryTargetCommitHistoryCommitHistoryConnection) GetPageInfo

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

type BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo

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

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

Information about pagination in a connection.

func (*BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo) GetEndCursor

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

func (*BranchHistoryTargetCommitHistoryCommitHistoryConnectionPageInfo) GetHasNextPage

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

type BranchHistoryTargetGitObject

type BranchHistoryTargetGitObject interface {

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

BranchHistoryTargetGitObject includes the requested fields of the GraphQL interface GitObject.

BranchHistoryTargetGitObject is implemented by the following types: BranchHistoryTargetBlob BranchHistoryTargetCommit BranchHistoryTargetTag BranchHistoryTargetTree The GraphQL type's documentation follows.

Represents a Git object.

type BranchHistoryTargetTag

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

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

Represents a Git tag.

func (*BranchHistoryTargetTag) GetTypename

func (v *BranchHistoryTargetTag) GetTypename() string

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

type BranchHistoryTargetTree

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

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

Represents a Git tree.

func (*BranchHistoryTargetTree) GetTypename

func (v *BranchHistoryTargetTree) GetTypename() string

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

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 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"`
}

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

Represents a Git commit.

func (*CommitNode) GetAdditions

func (v *CommitNode) GetAdditions() int

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

func (*CommitNode) GetCommittedDate

func (v *CommitNode) GetCommittedDate() time.Time

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

func (*CommitNode) GetDeletions

func (v *CommitNode) GetDeletions() int

GetDeletions returns CommitNode.Deletions, 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 (github scraper only)
	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(
	_ context.Context,
	params receiver.Settings,
	cfg internal.Config,
) (scraper.Metrics, 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"`
	// The HTTP URL for this repository
	Url string `json:"url"`
}

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.

func (*SearchNodeRepository) GetUrl added in v0.116.0

func (v *SearchNodeRepository) GetUrl() string

GetUrl returns SearchNodeRepository.Url, 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