Documentation
¶
Overview ¶
Package clients defines the interface for RepoClient and related structs.
Index ¶
- Variables
- type AllowDeletions
- type AllowForcePushes
- type BranchProtectionRule
- func (*BranchProtectionRule) Descriptor() ([]byte, []int)deprecated
- func (x *BranchProtectionRule) GetAllowDeletions() *AllowDeletions
- func (x *BranchProtectionRule) GetAllowForcePushes() *AllowForcePushes
- func (x *BranchProtectionRule) GetEnforceAdmins() *EnforceAdmins
- func (x *BranchProtectionRule) GetRequireLinearHistory() *RequireLinearHistory
- func (x *BranchProtectionRule) GetRequiredPullRequestReviews() *PullRequestReviewRule
- func (x *BranchProtectionRule) GetRequiredStatusChecks() *StatusChecksRule
- func (*BranchProtectionRule) ProtoMessage()
- func (x *BranchProtectionRule) ProtoReflect() protoreflect.Message
- func (x *BranchProtectionRule) Reset()
- func (x *BranchProtectionRule) String() string
- type BranchRef
- func (*BranchRef) Descriptor() ([]byte, []int)deprecated
- func (x *BranchRef) GetBranchProtectionRule() *BranchProtectionRule
- func (x *BranchRef) GetName() string
- func (x *BranchRef) GetProtected() bool
- func (*BranchRef) ProtoMessage()
- func (x *BranchRef) ProtoReflect() protoreflect.Message
- func (x *BranchRef) Reset()
- func (x *BranchRef) String() string
- type CheckRun
- type CheckRunApp
- type Commit
- type Contributor
- type EnforceAdmins
- type Label
- type PullRequest
- type PullRequestReviewRule
- func (*PullRequestReviewRule) Descriptor() ([]byte, []int)deprecated
- func (x *PullRequestReviewRule) GetDismissStaleReviews() bool
- func (x *PullRequestReviewRule) GetRequireCodeOwnerReviews() bool
- func (x *PullRequestReviewRule) GetRequiredApprovingReviewCount() int32
- func (*PullRequestReviewRule) ProtoMessage()
- func (x *PullRequestReviewRule) ProtoReflect() protoreflect.Message
- func (x *PullRequestReviewRule) Reset()
- func (x *PullRequestReviewRule) String() string
- type Release
- type ReleaseAsset
- type Repo
- type RepoClient
- type RequireLinearHistory
- func (*RequireLinearHistory) Descriptor() ([]byte, []int)deprecated
- func (x *RequireLinearHistory) GetEnabled() bool
- func (*RequireLinearHistory) ProtoMessage()
- func (x *RequireLinearHistory) ProtoReflect() protoreflect.Message
- func (x *RequireLinearHistory) Reset()
- func (x *RequireLinearHistory) String() string
- type Review
- type SearchRequest
- type SearchResponse
- type SearchResult
- type Status
- type StatusChecksRule
- func (*StatusChecksRule) Descriptor() ([]byte, []int)deprecated
- func (x *StatusChecksRule) GetContexts() []string
- func (x *StatusChecksRule) GetStrict() bool
- func (*StatusChecksRule) ProtoMessage()
- func (x *StatusChecksRule) ProtoReflect() protoreflect.Message
- func (x *StatusChecksRule) Reset()
- func (x *StatusChecksRule) String() string
- type User
- type WorkflowRun
Constants ¶
This section is empty.
Variables ¶
var File_clients_branch_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AllowDeletions ¶
type AllowDeletions struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // contains filtered or unexported fields }
func (*AllowDeletions) Descriptor
deprecated
func (*AllowDeletions) Descriptor() ([]byte, []int)
Deprecated: Use AllowDeletions.ProtoReflect.Descriptor instead.
func (*AllowDeletions) GetEnabled ¶
func (x *AllowDeletions) GetEnabled() bool
func (*AllowDeletions) ProtoMessage ¶
func (*AllowDeletions) ProtoMessage()
func (*AllowDeletions) ProtoReflect ¶
func (x *AllowDeletions) ProtoReflect() protoreflect.Message
func (*AllowDeletions) Reset ¶
func (x *AllowDeletions) Reset()
func (*AllowDeletions) String ¶
func (x *AllowDeletions) String() string
type AllowForcePushes ¶
type AllowForcePushes struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // contains filtered or unexported fields }
func (*AllowForcePushes) Descriptor
deprecated
func (*AllowForcePushes) Descriptor() ([]byte, []int)
Deprecated: Use AllowForcePushes.ProtoReflect.Descriptor instead.
func (*AllowForcePushes) GetEnabled ¶
func (x *AllowForcePushes) GetEnabled() bool
func (*AllowForcePushes) ProtoMessage ¶
func (*AllowForcePushes) ProtoMessage()
func (*AllowForcePushes) ProtoReflect ¶
func (x *AllowForcePushes) ProtoReflect() protoreflect.Message
func (*AllowForcePushes) Reset ¶
func (x *AllowForcePushes) Reset()
func (*AllowForcePushes) String ¶
func (x *AllowForcePushes) String() string
type BranchProtectionRule ¶
type BranchProtectionRule struct { AllowDeletions *AllowDeletions `protobuf:"bytes,1,opt,name=allow_deletions,json=allowDeletions,proto3" json:"allow_deletions,omitempty"` AllowForcePushes *AllowForcePushes `protobuf:"bytes,2,opt,name=allow_force_pushes,json=allowForcePushes,proto3" json:"allow_force_pushes,omitempty"` RequireLinearHistory *RequireLinearHistory `protobuf:"bytes,3,opt,name=require_linear_history,json=requireLinearHistory,proto3" json:"require_linear_history,omitempty"` EnforceAdmins *EnforceAdmins `protobuf:"bytes,4,opt,name=enforce_admins,json=enforceAdmins,proto3" json:"enforce_admins,omitempty"` RequiredStatusChecks *StatusChecksRule `protobuf:"bytes,5,opt,name=required_status_checks,json=requiredStatusChecks,proto3" json:"required_status_checks,omitempty"` RequiredPullRequestReviews *PullRequestReviewRule `` /* 143-byte string literal not displayed */ // contains filtered or unexported fields }
func (*BranchProtectionRule) Descriptor
deprecated
func (*BranchProtectionRule) Descriptor() ([]byte, []int)
Deprecated: Use BranchProtectionRule.ProtoReflect.Descriptor instead.
func (*BranchProtectionRule) GetAllowDeletions ¶
func (x *BranchProtectionRule) GetAllowDeletions() *AllowDeletions
func (*BranchProtectionRule) GetAllowForcePushes ¶
func (x *BranchProtectionRule) GetAllowForcePushes() *AllowForcePushes
func (*BranchProtectionRule) GetEnforceAdmins ¶
func (x *BranchProtectionRule) GetEnforceAdmins() *EnforceAdmins
func (*BranchProtectionRule) GetRequireLinearHistory ¶
func (x *BranchProtectionRule) GetRequireLinearHistory() *RequireLinearHistory
func (*BranchProtectionRule) GetRequiredPullRequestReviews ¶
func (x *BranchProtectionRule) GetRequiredPullRequestReviews() *PullRequestReviewRule
func (*BranchProtectionRule) GetRequiredStatusChecks ¶
func (x *BranchProtectionRule) GetRequiredStatusChecks() *StatusChecksRule
func (*BranchProtectionRule) ProtoMessage ¶
func (*BranchProtectionRule) ProtoMessage()
func (*BranchProtectionRule) ProtoReflect ¶
func (x *BranchProtectionRule) ProtoReflect() protoreflect.Message
func (*BranchProtectionRule) Reset ¶
func (x *BranchProtectionRule) Reset()
func (*BranchProtectionRule) String ¶
func (x *BranchProtectionRule) String() string
type BranchRef ¶
type BranchRef struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Protected bool `protobuf:"varint,2,opt,name=protected,proto3" json:"protected,omitempty"` BranchProtectionRule *BranchProtectionRule `protobuf:"bytes,3,opt,name=branch_protection_rule,json=branchProtectionRule,proto3" json:"branch_protection_rule,omitempty"` // contains filtered or unexported fields }
func (*BranchRef) Descriptor
deprecated
func (*BranchRef) GetBranchProtectionRule ¶
func (x *BranchRef) GetBranchProtectionRule() *BranchProtectionRule
func (*BranchRef) GetProtected ¶
func (*BranchRef) ProtoMessage ¶
func (*BranchRef) ProtoMessage()
func (*BranchRef) ProtoReflect ¶
func (x *BranchRef) ProtoReflect() protoreflect.Message
type CheckRun ¶
type CheckRun struct { Status string Conclusion string URL string App CheckRunApp }
CheckRun is a single instance of a VCS CheckRun.
type CheckRunApp ¶
type CheckRunApp struct {
Slug string
}
CheckRunApp is the app running the Check.
type Contributor ¶
Contributor represents a contributor to a repo.
type EnforceAdmins ¶
type EnforceAdmins struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // contains filtered or unexported fields }
func (*EnforceAdmins) Descriptor
deprecated
func (*EnforceAdmins) Descriptor() ([]byte, []int)
Deprecated: Use EnforceAdmins.ProtoReflect.Descriptor instead.
func (*EnforceAdmins) GetEnabled ¶
func (x *EnforceAdmins) GetEnabled() bool
func (*EnforceAdmins) ProtoMessage ¶
func (*EnforceAdmins) ProtoMessage()
func (*EnforceAdmins) ProtoReflect ¶
func (x *EnforceAdmins) ProtoReflect() protoreflect.Message
func (*EnforceAdmins) Reset ¶
func (x *EnforceAdmins) Reset()
func (*EnforceAdmins) String ¶
func (x *EnforceAdmins) String() string
type PullRequest ¶
type PullRequest struct { MergedAt time.Time MergeCommit Commit Number int HeadSHA string Labels []Label Reviews []Review Author User }
PullRequest struct represents a PR as returned by RepoClient. nolint: govet
type PullRequestReviewRule ¶
type PullRequestReviewRule struct { RequiredApprovingReviewCount int32 `` /* 150-byte string literal not displayed */ DismissStaleReviews bool `protobuf:"varint,2,opt,name=dismiss_stale_reviews,json=dismissStaleReviews,proto3" json:"dismiss_stale_reviews,omitempty"` RequireCodeOwnerReviews bool `` /* 135-byte string literal not displayed */ // contains filtered or unexported fields }
func (*PullRequestReviewRule) Descriptor
deprecated
func (*PullRequestReviewRule) Descriptor() ([]byte, []int)
Deprecated: Use PullRequestReviewRule.ProtoReflect.Descriptor instead.
func (*PullRequestReviewRule) GetDismissStaleReviews ¶
func (x *PullRequestReviewRule) GetDismissStaleReviews() bool
func (*PullRequestReviewRule) GetRequireCodeOwnerReviews ¶
func (x *PullRequestReviewRule) GetRequireCodeOwnerReviews() bool
func (*PullRequestReviewRule) GetRequiredApprovingReviewCount ¶
func (x *PullRequestReviewRule) GetRequiredApprovingReviewCount() int32
func (*PullRequestReviewRule) ProtoMessage ¶
func (*PullRequestReviewRule) ProtoMessage()
func (*PullRequestReviewRule) ProtoReflect ¶
func (x *PullRequestReviewRule) ProtoReflect() protoreflect.Message
func (*PullRequestReviewRule) Reset ¶
func (x *PullRequestReviewRule) Reset()
func (*PullRequestReviewRule) String ¶
func (x *PullRequestReviewRule) String() string
type Release ¶
type Release struct { TagName string URL string TargetCommitish string Assets []ReleaseAsset }
Release represents a release version of a package/repo.
type ReleaseAsset ¶
ReleaseAsset is part of the Release bundle.
type Repo ¶
type Repo interface { URL() string String() string Org() Repo IsValid() error Metadata() []string AppendMetadata(metadata ...string) // TODO: Find a better alterntive. IsScorecardRepo() bool }
Repo interface uniquely identifies a repo.
type RepoClient ¶
type RepoClient interface { InitRepo(repo Repo) error URL() string IsArchived() (bool, error) ListFiles(predicate func(string) (bool, error)) ([]string, error) GetFileContent(filename string) ([]byte, error) ListMergedPRs() ([]PullRequest, error) ListBranches() ([]*BranchRef, error) GetDefaultBranch() (*BranchRef, error) ListCommits() ([]Commit, error) ListReleases() ([]Release, error) ListContributors() ([]Contributor, error) ListSuccessfulWorkflowRuns(filename string) ([]WorkflowRun, error) ListCheckRunsForRef(ref string) ([]CheckRun, error) ListStatuses(ref string) ([]Status, error) Search(request SearchRequest) (SearchResponse, error) Close() error }
RepoClient interface is used by Scorecard checks to access a repo.
type RequireLinearHistory ¶
type RequireLinearHistory struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // contains filtered or unexported fields }
func (*RequireLinearHistory) Descriptor
deprecated
func (*RequireLinearHistory) Descriptor() ([]byte, []int)
Deprecated: Use RequireLinearHistory.ProtoReflect.Descriptor instead.
func (*RequireLinearHistory) GetEnabled ¶
func (x *RequireLinearHistory) GetEnabled() bool
func (*RequireLinearHistory) ProtoMessage ¶
func (*RequireLinearHistory) ProtoMessage()
func (*RequireLinearHistory) ProtoReflect ¶
func (x *RequireLinearHistory) ProtoReflect() protoreflect.Message
func (*RequireLinearHistory) Reset ¶
func (x *RequireLinearHistory) Reset()
func (*RequireLinearHistory) String ¶
func (x *RequireLinearHistory) String() string
type SearchRequest ¶
SearchRequest queries a repo for `Query`. If `Filename` is provided, only matching filenames are queried. If `Path` is provided, only files with matching paths are queried.
type SearchResponse ¶
type SearchResponse struct { Results []SearchResult Hits int }
SearchResponse returns the results from a search request on a repo.
type SearchResult ¶
type SearchResult struct {
Path string
}
SearchResult represents a matching result from the search query.
type StatusChecksRule ¶
type StatusChecksRule struct { Strict bool `protobuf:"varint,1,opt,name=strict,proto3" json:"strict,omitempty"` Contexts []string `protobuf:"bytes,2,rep,name=contexts,proto3" json:"contexts,omitempty"` // contains filtered or unexported fields }
func (*StatusChecksRule) Descriptor
deprecated
func (*StatusChecksRule) Descriptor() ([]byte, []int)
Deprecated: Use StatusChecksRule.ProtoReflect.Descriptor instead.
func (*StatusChecksRule) GetContexts ¶
func (x *StatusChecksRule) GetContexts() []string
func (*StatusChecksRule) GetStrict ¶
func (x *StatusChecksRule) GetStrict() bool
func (*StatusChecksRule) ProtoMessage ¶
func (*StatusChecksRule) ProtoMessage()
func (*StatusChecksRule) ProtoReflect ¶
func (x *StatusChecksRule) ProtoReflect() protoreflect.Message
func (*StatusChecksRule) Reset ¶
func (x *StatusChecksRule) Reset()
func (*StatusChecksRule) String ¶
func (x *StatusChecksRule) String() string
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package githubrepo implements clients.RepoClient for GitHub.
|
Package githubrepo implements clients.RepoClient for GitHub. |
roundtripper
Package roundtripper has implementations of http.RoundTripper useful to clients.RepoClient.
|
Package roundtripper has implementations of http.RoundTripper useful to clients.RepoClient. |
Package mockrepo is a generated GoMock package.
|
Package mockrepo is a generated GoMock package. |