githubrepo

package
v4.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Overview

Package githubrepo implements clients.RepoClient for GitHub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGithubRepoClient

func CreateGithubRepoClient(ctx context.Context, logger *log.Logger) clients.RepoClient

CreateGithubRepoClient returns a Client which implements RepoClient interface.

func CreateGithubRepoClientWithTransport added in v4.1.0

func CreateGithubRepoClientWithTransport(ctx context.Context, rt http.RoundTripper) clients.RepoClient

CreateGithubRepoClientWithTransport returns a Client which implements RepoClient interface.

func CreateOssFuzzRepoClient deprecated

func CreateOssFuzzRepoClient(ctx context.Context, logger *log.Logger) (clients.RepoClient, error)

CreateOssFuzzRepoClient returns a RepoClient implementation intialized to `google/oss-fuzz` GitHub repository.

Deprecated: Searching the github.com/google/oss-fuzz repo for projects is flawed. Use a constructor from clients/ossfuzz instead. https://github.com/ossf/scorecard/issues/2670

func MakeGithubRepo

func MakeGithubRepo(input string) (clients.Repo, error)

MakeGithubRepo takes input of form "owner/repo" or "github.com/owner/repo" and returns an implementation of clients.Repo interface.

Types

type Client

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

Client is GitHub-specific implementation of RepoClient.

func (*Client) Close

func (client *Client) Close() error

Close implements RepoClient.Close.

func (*Client) GetBranch added in v4.3.1

func (client *Client) GetBranch(branch string) (*clients.BranchRef, error)

GetBranch implements RepoClient.GetBranch.

func (*Client) GetCreatedAt added in v4.6.0

func (client *Client) GetCreatedAt() (time.Time, error)

GetCreatedAt is a getter for repo.CreatedAt.

func (*Client) GetDefaultBranch

func (client *Client) GetDefaultBranch() (*clients.BranchRef, error)

GetDefaultBranch implements RepoClient.GetDefaultBranch.

func (*Client) GetDefaultBranchName added in v4.6.0

func (client *Client) GetDefaultBranchName() (string, error)

GetDefaultBranchName implements RepoClient.GetDefaultBranchName.

func (*Client) GetFileContent

func (client *Client) GetFileContent(filename string) ([]byte, error)

GetFileContent implements RepoClient.GetFileContent.

func (*Client) GetOrgRepoClient added in v4.10.5

func (client *Client) GetOrgRepoClient(ctx context.Context) (clients.RepoClient, error)

func (*Client) InitRepo

func (client *Client) InitRepo(inputRepo clients.Repo, commitSHA string, commitDepth int) error

InitRepo sets up the GitHub repo in local storage for improving performance and GitHub token usage efficiency.

func (*Client) IsArchived

func (client *Client) IsArchived() (bool, error)

IsArchived implements RepoClient.IsArchived.

func (*Client) ListCheckRunsForRef

func (client *Client) ListCheckRunsForRef(ref string) ([]clients.CheckRun, error)

ListCheckRunsForRef implements RepoClient.ListCheckRunsForRef.

func (*Client) ListCommits

func (client *Client) ListCommits() ([]clients.Commit, error)

ListCommits implements RepoClient.ListCommits.

func (*Client) ListContributors

func (client *Client) ListContributors() ([]clients.User, error)

ListContributors implements RepoClient.ListContributors.

func (*Client) ListFiles

func (client *Client) ListFiles(predicate func(string) (bool, error)) ([]string, error)

ListFiles implements RepoClient.ListFiles.

func (*Client) ListIssues

func (client *Client) ListIssues() ([]clients.Issue, error)

ListIssues implements RepoClient.ListIssues.

func (*Client) ListLicenses added in v4.9.0

func (client *Client) ListLicenses() ([]clients.License, error)

ListLicenses implements RepoClient.ListLicenses.

func (*Client) ListProgrammingLanguages added in v4.4.0

func (client *Client) ListProgrammingLanguages() ([]clients.Language, error)

ListProgrammingLanguages implements RepoClient.ListProgrammingLanguages.

func (*Client) ListReleases

func (client *Client) ListReleases() ([]clients.Release, error)

ListReleases implements RepoClient.ListReleases.

func (*Client) ListStatuses

func (client *Client) ListStatuses(ref string) ([]clients.Status, error)

ListStatuses implements RepoClient.ListStatuses.

func (*Client) ListSuccessfulWorkflowRuns

func (client *Client) ListSuccessfulWorkflowRuns(filename string) ([]clients.WorkflowRun, error)

ListSuccessfulWorkflowRuns implements RepoClient.WorkflowRunsByFilename.

func (*Client) ListWebhooks added in v4.2.0

func (client *Client) ListWebhooks() ([]clients.Webhook, error)

ListWebhooks implements RepoClient.ListWebhooks.

func (*Client) LocalPath added in v4.9.0

func (client *Client) LocalPath() (string, error)

LocalPath implements RepoClient.LocalPath.

func (*Client) Search

func (client *Client) Search(request clients.SearchRequest) (clients.SearchResponse, error)

Search implements RepoClient.Search.

func (*Client) SearchCommits added in v4.6.0

func (client *Client) SearchCommits(request clients.SearchCommitsOptions) ([]clients.Commit, error)

SearchCommits implements RepoClient.SearchCommits.

func (*Client) URI

func (client *Client) URI() string

URI implements RepoClient.URI.

Directories

Path Synopsis
internal
Package roundtripper has implementations of http.RoundTripper useful to clients.RepoClient.
Package roundtripper has implementations of http.RoundTripper useful to clients.RepoClient.
tokens
Package tokens defines interface to access GitHub PATs.
Package tokens defines interface to access GitHub PATs.
tokens/server
Package main implements the GitHub token server.
Package main implements the GitHub token server.

Jump to

Keyboard shortcuts

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