githubrepo

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

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 *zap.Logger) clients.RepoClient

CreateGithubRepoClient returns a Client which implements RepoClient interface.

func CreateOssFuzzRepoClient added in v3.2.1

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

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

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.

func NewLogger

func NewLogger(logLevel zapcore.Level) (*zap.Logger, error)

NewLogger creates an instance of *zap.Logger.

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) GetDefaultBranch

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

GetDefaultBranch implements RepoClient.GetDefaultBranch.

func (*Client) GetFileContent

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

GetFileContent implements RepoClient.GetFileContent.

func (*Client) InitRepo

func (client *Client) InitRepo(inputRepo clients.Repo) 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) ListBranches

func (client *Client) ListBranches() ([]*clients.BranchRef, error)

ListBranches implements RepoClient.ListBranches.

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.Contributor, 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 added in v3.2.1

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

ListIssues implements RepoClient.ListIssues.

func (*Client) ListMergedPRs

func (client *Client) ListMergedPRs() ([]clients.PullRequest, error)

ListMergedPRs implements RepoClient.ListMergedPRs.

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) Search

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

Search implements RepoClient.Search.

func (*Client) URI added in v3.1.0

func (client *Client) URI() string

URI implements RepoClient.URI.

Directories

Path Synopsis
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