Documentation
¶
Overview ¶
Package clients defines the interface for RepoClient and related structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRepoUnavailableError ¶
NewRepoUnavailableError returns a wrapped error of type ErrRepoUnavailable.
Types ¶
type BranchProtectionRule ¶
type BranchProtectionRule struct {
RequiredApprovingReviewCount int
}
BranchProtectionRule specifies rules for a Git branch.
type BranchRef ¶
type BranchRef struct {
Name string
BranchProtectionRule BranchProtectionRule
}
BranchRef holds data about a Git branch.
type Commit ¶ added in v2.1.3
type Commit struct {
CommittedDate time.Time
Message string
SHA string
Committer User
AuthoredByCommitter bool
}
Commit represents a Git commit.
type ErrRepoUnavailable ¶
type ErrRepoUnavailable struct {
// contains filtered or unexported fields
}
ErrRepoUnavailable is returned when RepoClient is unable to reach the repo. UPGRADEv2: use ErrRepoUnreachable instead.
func (*ErrRepoUnavailable) Error ¶
func (e *ErrRepoUnavailable) Error() string
Error returns the error string.
func (*ErrRepoUnavailable) Unwrap ¶
func (e *ErrRepoUnavailable) Unwrap() error
Unwrap returns the wrapped error.
type PullRequest ¶
type PullRequest struct {
MergedAt time.Time
MergeCommit Commit
Number int
Labels []Label
Reviews []Review
}
PullRequest struct represents a PR as returned by RepoClient. nolint: govet
type RepoClient ¶
type RepoClient interface {
InitRepo(owner, repo string) error
IsArchived() (bool, error)
ListFiles(predicate func(string) (bool, error)) ([]string, error)
GetFileContent(filename string) ([]byte, error)
ListMergedPRs() ([]PullRequest, error)
GetDefaultBranch() (BranchRef, error)
ListCommits() ([]Commit, error)
Close() error
}
RepoClient interface is used by Scorecard checks to access a repo.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package githubrepo implements clients.RepoClient for GitHub.
|
Package githubrepo implements clients.RepoClient for GitHub. |
Click to show internal directories.
Click to hide internal directories.