Documentation ¶
Index ¶
- Variables
- type ClientAdapterImpl
- func (ca *ClientAdapterImpl) GetAuthorizedUser() (*models.User, error)
- func (ca *ClientAdapterImpl) GetBranchProtection(owner string, repo *models.Repository, branch string) (*models.Protection, error)
- func (ca *ClientAdapterImpl) GetCommit(owner string, repo string, sha string) (*models.RepositoryCommit, error)
- func (ca *ClientAdapterImpl) GetFileContent(owner string, repo string, filepath string, ref string) ([]byte, error)
- func (ca *ClientAdapterImpl) GetOrganization(owner string) (*models.Organization, error)
- func (ca *ClientAdapterImpl) GetPipelines(owner string, repo string, branch string) ([]*pipelineModels.Pipeline, error)
- func (ca *ClientAdapterImpl) GetRegistry(organization *models.Organization) (*models.PackageRegistry, error)
- func (ca *ClientAdapterImpl) GetRepository(owner string, repo string, branch string) (*models.Repository, error)
- func (*ClientAdapterImpl) Init(client *http.Client, token string, host string) error
- func (ca *ClientAdapterImpl) ListOrganizationMembers(organization string) ([]*models.User, error)
- func (ca *ClientAdapterImpl) ListRepositoryBranches(owner string, repo string) ([]*models.Branch, error)
- func (ca *ClientAdapterImpl) ListSupportedChecksIDs() ([]string, error)
- type GithubClient
- func InitClient(client *http.Client, token string, host string) (GithubClient, error)
- func InitMocks() GithubClient
- func MockGetBranchProtections(protection *github.Protection) *GithubClient
- func MockGetContent(content *github.RepositoryContent) *GithubClient
- func MockGetOrganization(org *github.Organization) *GithubClient
- func MockGetOrganizationMembers(users []*github.User) *GithubClient
- func MockGetOrganizationWebhooks(hooks []*github.Hook) *GithubClient
- func MockGetRepo(repo *github.Repository) *GithubClient
- func MockGetRepositoryWebhooks(hooks []*github.Hook) *GithubClient
- func MockGetSignaturesOfProtectedBranch(signedCommits *github.SignaturesProtectedBranch) *GithubClient
- func MockGetWorkflows(workflows *github.Workflows) *GithubClient
- func MockListCommits(commits []*github.RepositoryCommit) *GithubClient
- func MockListOrganizationPackages(packages []*github.Package) *GithubClient
- type GithubClientImpl
- func (gca *GithubClientImpl) GetAuthorizedUser() (*github.User, *github.Response, error)
- func (gca *GithubClientImpl) GetBranchProtection(organization, repo, branch string) (*github.Protection, *github.Response, error)
- func (gca *GithubClientImpl) GetCommit(organization string, repositoryName string, sha string) (*github.RepositoryCommit, *github.Response, error)
- func (gca *GithubClientImpl) GetContent(owner, repo, filepath, ref string) (fileContent *github.RepositoryContent, ...)
- func (gca *GithubClientImpl) GetOrganization(owner string) (*github.Organization, *github.Response, error)
- func (gca *GithubClientImpl) GetRepository(owner, repo string) (*github.Repository, *github.Response, error)
- func (gca *GithubClientImpl) GetRepositoryBranch(organization, repositoryName, branch string, followRedirects bool) (*github.Branch, *github.Response, error)
- func (gca *GithubClientImpl) GetSignaturesOfProtectedBranch(owner, repo, branch string) (*github.SignaturesProtectedBranch, *github.Response, error)
- func (gca *GithubClientImpl) GetWorkflows(owner, repo string) (*github.Workflows, *github.Response, error)
- func (gca *GithubClientImpl) ListCommits(organization string, repositoryName string, opts *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error)
- func (gca *GithubClientImpl) ListOrganizationHooks(owner string) (hooks []*github.Hook, resp *github.Response, err error)
- func (gca *GithubClientImpl) ListOrganizationMembers(organization string, opts *github.ListMembersOptions) ([]*github.User, *github.Response, error)
- func (gca *GithubClientImpl) ListOrganizationPackages(owner string, packageType string) ([]*github.Package, *github.Response, error)
- func (gca *GithubClientImpl) ListPullRequestCommits(owner string, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)
- func (gca *GithubClientImpl) ListPullRequestReviews(owner, repo string, number int, opts *github.ListOptions) ([]*github.PullRequestReview, *github.Response, error)
- func (gca *GithubClientImpl) ListPullRequestsWithCommit(owner, repository, sha string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
- func (gca *GithubClientImpl) ListRepositoryBranches(organization string, repositoryName string) ([]*github.Branch, *github.Response, error)
- func (gca *GithubClientImpl) ListRepositoryCollaborators(owner, repo string) ([]*github.User, *github.Response, error)
- func (gca *GithubClientImpl) ListRepositoryHooks(owner, repo string) (hooks []*github.Hook, resp *github.Response, err error)
- func (gca *GithubClientImpl) ListRepositoryTopics(owner, repo string) ([]string, *github.Response, error)
- type MockGithubClientAdapter
- func (mgca *MockGithubClientAdapter) GetAuthorizedUser() (*github.User, *github.Response, error)
- func (mgca *MockGithubClientAdapter) GetBranch(owner, repo, branch string, followRedirects bool) (*github.Branch, error)
- func (*MockGithubClientAdapter) GetBranchProtection(owner string, repo string, branch string) (*github.Protection, *github.Response, error)
- func (mgca *MockGithubClientAdapter) GetCommit(organization string, repositoryName string, sha string) (*github.RepositoryCommit, *github.Response, error)
- func (mgca *MockGithubClientAdapter) GetContent(owner, repo, path, ref string) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, ...)
- func (mgca *MockGithubClientAdapter) GetOrganization(orgName string) (*github.Organization, *github.Response, error)
- func (mgca *MockGithubClientAdapter) GetRepository(owner, repo string) (*github.Repository, *github.Response, error)
- func (mgca *MockGithubClientAdapter) GetRepositoryBranch(owner, repo, branch string, followRedirects bool) (*github.Branch, *github.Response, error)
- func (*MockGithubClientAdapter) GetSignaturesOfProtectedBranch(owner string, repo string, branch string) (*github.SignaturesProtectedBranch, *github.Response, error)
- func (mgca *MockGithubClientAdapter) GetWorkflows(owner, repo string) (*github.Workflows, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListCommits(organization string, repositoryName string, opts *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListMembers(organization string, options github.ListMembersOptions) ([]*github.User, error)
- func (mgca *MockGithubClientAdapter) ListOrganizationHooks(owner string) ([]*github.Hook, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListOrganizationMembers(organization string, options *github.ListMembersOptions) ([]*github.User, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListOrganizationPackages(owner string, packagetype string) ([]*github.Package, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListPullRequestCommits(owner string, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListPullRequestReviews(owner, repo string, number int, opts *github.ListOptions) ([]*github.PullRequestReview, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListPullRequestsWithCommit(owner, repository, sha string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListRepositoryBranches(owner, repo string) ([]*github.Branch, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListRepositoryCollaborators(owner string, repo string) ([]*github.User, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListRepositoryHooks(owner, repo string) ([]*github.Hook, *github.Response, error)
- func (mgca *MockGithubClientAdapter) ListRepositoryTopics(owner, repo string) ([]string, *github.Response, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ListMembersFunc func(organization string, options github.ListMembersOptions) ([]*github.User, error) GetBranchFunc func(owner, repo, branch string, followRedirects bool) (*github.Branch, error) ListOrganizationMembersFunc func(organization string, options *github.ListMembersOptions) ([]*github.User, *github.Response, error) GetRepositoryBranchFunc func(owner, repo, branch string, followRedirects bool) (*github.Branch, *github.Response, error) ListRepositoryBranchesFunc func(owner string, repo string) ([]*github.Branch, *github.Response, error) GetAuthorizedUserFunc func() (*github.User, *github.Response, error) GetCommitFunc func(organization string, repositoryName string, sha string) (*github.RepositoryCommit, *github.Response, error) ListCommitsFunc func(organization string, repositoryName string, opts *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error) GetBranchProtectionFunc func(owner, repo, branch string) (*github.Protection, *github.Response, error) GetSignaturesOfProtectedBranchFunc func(owner, repo, branch string) (*github.SignaturesProtectedBranch, *github.Response, error) ListPullRequestsWithCommitFunc func(owner, repository, sha string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error) ListPullRequestReviewsFunc func(owner, repo string, number int, opts *github.ListOptions) ([]*github.PullRequestReview, *github.Response, error) ListRepositoryTopicsFunc func(owner, repo string) ([]string, *github.Response, error) ListPullRequestCommitsFunc func(owner string, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error) ListRepositoryCollaboratorsFunc func(owner string, repo string) ([]*github.User, *github.Response, error) GetRepositoryFunc func(owner, repo string) (*github.Repository, *github.Response, error) GetOrganizationFunc func(orgName string) (*github.Organization, *github.Response, error) GetWorkflowsFunc func(owner, repo string) (*github.Workflows, *github.Response, error) GetContentFunc func(owner, repo, path string, ref string) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error) ListOrganizationHooksFunc func(owner string) (hooks []*github.Hook, resp *github.Response, err error) ListRepositoryHooksFunc func(owner, repo string) (hooks []*github.Hook, resp *github.Response, err error) ListOrganizationPackagesFunc func(owner string, packagetype string) ([]*github.Package, *github.Response, error) )
Functions ¶
This section is empty.
Types ¶
type ClientAdapterImpl ¶
type ClientAdapterImpl struct {
// contains filtered or unexported fields
}
var (
Adapter ClientAdapterImpl
)
func (*ClientAdapterImpl) GetAuthorizedUser ¶
func (ca *ClientAdapterImpl) GetAuthorizedUser() (*models.User, error)
func (*ClientAdapterImpl) GetBranchProtection ¶
func (ca *ClientAdapterImpl) GetBranchProtection(owner string, repo *models.Repository, branch string) (*models.Protection, error)
GetBranchProtection implements clients.ClientAdapter
func (*ClientAdapterImpl) GetCommit ¶
func (ca *ClientAdapterImpl) GetCommit(owner string, repo string, sha string) (*models.RepositoryCommit, error)
GetCommit implements clients.ClientAdapter
func (*ClientAdapterImpl) GetFileContent ¶
func (*ClientAdapterImpl) GetOrganization ¶
func (ca *ClientAdapterImpl) GetOrganization(owner string) (*models.Organization, error)
func (*ClientAdapterImpl) GetPipelines ¶
func (ca *ClientAdapterImpl) GetPipelines(owner string, repo string, branch string) ([]*pipelineModels.Pipeline, error)
func (*ClientAdapterImpl) GetRegistry ¶
func (ca *ClientAdapterImpl) GetRegistry(organization *models.Organization) (*models.PackageRegistry, error)
func (*ClientAdapterImpl) GetRepository ¶
func (ca *ClientAdapterImpl) GetRepository(owner string, repo string, branch string) (*models.Repository, error)
GetRepository implements clients.ClientAdapter
func (*ClientAdapterImpl) ListOrganizationMembers ¶
func (ca *ClientAdapterImpl) ListOrganizationMembers(organization string) ([]*models.User, error)
func (*ClientAdapterImpl) ListRepositoryBranches ¶
func (ca *ClientAdapterImpl) ListRepositoryBranches(owner string, repo string) ([]*models.Branch, error)
listRepositoryBranches implements clients.ClientAdapter
func (*ClientAdapterImpl) ListSupportedChecksIDs ¶ added in v0.1.5
func (ca *ClientAdapterImpl) ListSupportedChecksIDs() ([]string, error)
type GithubClient ¶
type GithubClient interface { GetAuthorizedUser() (*github.User, *github.Response, error) ListOrganizationMembers(organization string, options *github.ListMembersOptions) ([]*github.User, *github.Response, error) ListRepositoryBranches(organization string, repositoryName string) ([]*github.Branch, *github.Response, error) GetRepositoryBranch(owner, repo, branch string, followRedirects bool) (*github.Branch, *github.Response, error) GetCommit(organization string, repositoryName string, sha string) (*github.RepositoryCommit, *github.Response, error) ListCommits(organization string, repositoryName string, opts *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error) GetBranchProtection(owner string, repo string, branch string) (*github.Protection, *github.Response, error) GetSignaturesOfProtectedBranch(owner, repo, branch string) (*github.SignaturesProtectedBranch, *github.Response, error) ListRepositoryCollaborators(owner string, repo string) ([]*github.User, *github.Response, error) ListPullRequestsWithCommit(owner, repository, sha string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error) ListPullRequestReviews(owner, repo string, number int, opts *github.ListOptions) ([]*github.PullRequestReview, *github.Response, error) ListRepositoryTopics(owner, repo string) ([]string, *github.Response, error) ListPullRequestCommits(owner string, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error) GetRepository(owner, repo string) (*github.Repository, *github.Response, error) GetOrganization(owner string) (*github.Organization, *github.Response, error) GetWorkflows(owner, repo string) (*github.Workflows, *github.Response, error) GetContent(owner, repo, filepath, ref string) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error) ListOrganizationHooks(owner string) (hooks []*github.Hook, resp *github.Response, err error) ListRepositoryHooks(owner, repo string) (hooks []*github.Hook, resp *github.Response, err error) ListOrganizationPackages(owner string, packageType string) ([]*github.Package, *github.Response, error) }
var (
Client GithubClient
)
func InitClient ¶
func InitMocks ¶
func InitMocks() GithubClient
func MockGetBranchProtections ¶
func MockGetBranchProtections(protection *github.Protection) *GithubClient
func MockGetContent ¶
func MockGetContent(content *github.RepositoryContent) *GithubClient
func MockGetOrganization ¶
func MockGetOrganization(org *github.Organization) *GithubClient
func MockGetOrganizationMembers ¶
func MockGetOrganizationMembers(users []*github.User) *GithubClient
func MockGetOrganizationWebhooks ¶
func MockGetOrganizationWebhooks(hooks []*github.Hook) *GithubClient
func MockGetRepo ¶
func MockGetRepo(repo *github.Repository) *GithubClient
func MockGetRepositoryWebhooks ¶
func MockGetRepositoryWebhooks(hooks []*github.Hook) *GithubClient
func MockGetSignaturesOfProtectedBranch ¶
func MockGetSignaturesOfProtectedBranch(signedCommits *github.SignaturesProtectedBranch) *GithubClient
func MockGetWorkflows ¶
func MockGetWorkflows(workflows *github.Workflows) *GithubClient
func MockListCommits ¶
func MockListCommits(commits []*github.RepositoryCommit) *GithubClient
func MockListOrganizationPackages ¶
func MockListOrganizationPackages(packages []*github.Package) *GithubClient
type GithubClientImpl ¶
type GithubClientImpl struct {
// contains filtered or unexported fields
}
func (*GithubClientImpl) GetAuthorizedUser ¶
func (*GithubClientImpl) GetBranchProtection ¶
func (gca *GithubClientImpl) GetBranchProtection(organization, repo, branch string) (*github.Protection, *github.Response, error)
func (*GithubClientImpl) GetCommit ¶
func (gca *GithubClientImpl) GetCommit(organization string, repositoryName string, sha string) (*github.RepositoryCommit, *github.Response, error)
func (*GithubClientImpl) GetContent ¶
func (gca *GithubClientImpl) GetContent(owner, repo, filepath, ref string) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error)
func (*GithubClientImpl) GetOrganization ¶
func (gca *GithubClientImpl) GetOrganization(owner string) (*github.Organization, *github.Response, error)
func (*GithubClientImpl) GetRepository ¶
func (gca *GithubClientImpl) GetRepository(owner, repo string) (*github.Repository, *github.Response, error)
func (*GithubClientImpl) GetRepositoryBranch ¶
func (*GithubClientImpl) GetSignaturesOfProtectedBranch ¶
func (gca *GithubClientImpl) GetSignaturesOfProtectedBranch(owner, repo, branch string) (*github.SignaturesProtectedBranch, *github.Response, error)
func (*GithubClientImpl) GetWorkflows ¶
func (*GithubClientImpl) ListCommits ¶
func (gca *GithubClientImpl) ListCommits(organization string, repositoryName string, opts *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error)
func (*GithubClientImpl) ListOrganizationHooks ¶
func (gca *GithubClientImpl) ListOrganizationHooks(owner string) (hooks []*github.Hook, resp *github.Response, err error)
need admin:org_hook
func (*GithubClientImpl) ListOrganizationMembers ¶
func (gca *GithubClientImpl) ListOrganizationMembers(organization string, opts *github.ListMembersOptions) ([]*github.User, *github.Response, error)
func (*GithubClientImpl) ListOrganizationPackages ¶
func (gca *GithubClientImpl) ListOrganizationPackages(owner string, packageType string) ([]*github.Package, *github.Response, error)
need read:packages
func (*GithubClientImpl) ListPullRequestCommits ¶
func (gca *GithubClientImpl) ListPullRequestCommits(owner string, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)
func (*GithubClientImpl) ListPullRequestReviews ¶
func (gca *GithubClientImpl) ListPullRequestReviews(owner, repo string, number int, opts *github.ListOptions) ([]*github.PullRequestReview, *github.Response, error)
func (*GithubClientImpl) ListPullRequestsWithCommit ¶
func (gca *GithubClientImpl) ListPullRequestsWithCommit(owner, repository, sha string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
func (*GithubClientImpl) ListRepositoryBranches ¶
func (*GithubClientImpl) ListRepositoryCollaborators ¶
func (*GithubClientImpl) ListRepositoryHooks ¶
func (gca *GithubClientImpl) ListRepositoryHooks(owner, repo string) (hooks []*github.Hook, resp *github.Response, err error)
need admin:repo_hook->read:repo_hook
func (*GithubClientImpl) ListRepositoryTopics ¶
type MockGithubClientAdapter ¶
type MockGithubClientAdapter struct { }
func (*MockGithubClientAdapter) GetAuthorizedUser ¶
func (*MockGithubClientAdapter) GetBranchProtection ¶
func (*MockGithubClientAdapter) GetBranchProtection(owner string, repo string, branch string) (*github.Protection, *github.Response, error)
func (*MockGithubClientAdapter) GetCommit ¶
func (mgca *MockGithubClientAdapter) GetCommit(organization string, repositoryName string, sha string) (*github.RepositoryCommit, *github.Response, error)
func (*MockGithubClientAdapter) GetContent ¶
func (mgca *MockGithubClientAdapter) GetContent(owner, repo, path, ref string) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
func (*MockGithubClientAdapter) GetOrganization ¶
func (mgca *MockGithubClientAdapter) GetOrganization(orgName string) (*github.Organization, *github.Response, error)
func (*MockGithubClientAdapter) GetRepository ¶
func (mgca *MockGithubClientAdapter) GetRepository(owner, repo string) (*github.Repository, *github.Response, error)
func (*MockGithubClientAdapter) GetRepositoryBranch ¶
func (*MockGithubClientAdapter) GetSignaturesOfProtectedBranch ¶
func (*MockGithubClientAdapter) GetSignaturesOfProtectedBranch(owner string, repo string, branch string) (*github.SignaturesProtectedBranch, *github.Response, error)
func (*MockGithubClientAdapter) GetWorkflows ¶
func (*MockGithubClientAdapter) ListCommits ¶
func (mgca *MockGithubClientAdapter) ListCommits(organization string, repositoryName string, opts *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error)
func (*MockGithubClientAdapter) ListMembers ¶
func (mgca *MockGithubClientAdapter) ListMembers(organization string, options github.ListMembersOptions) ([]*github.User, error)
func (*MockGithubClientAdapter) ListOrganizationHooks ¶
func (*MockGithubClientAdapter) ListOrganizationMembers ¶
func (mgca *MockGithubClientAdapter) ListOrganizationMembers(organization string, options *github.ListMembersOptions) ([]*github.User, *github.Response, error)
func (*MockGithubClientAdapter) ListOrganizationPackages ¶
func (*MockGithubClientAdapter) ListPullRequestCommits ¶
func (mgca *MockGithubClientAdapter) ListPullRequestCommits(owner string, repo string, number int, opts *github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error)
func (*MockGithubClientAdapter) ListPullRequestReviews ¶
func (mgca *MockGithubClientAdapter) ListPullRequestReviews(owner, repo string, number int, opts *github.ListOptions) ([]*github.PullRequestReview, *github.Response, error)
func (*MockGithubClientAdapter) ListPullRequestsWithCommit ¶
func (mgca *MockGithubClientAdapter) ListPullRequestsWithCommit(owner, repository, sha string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
func (*MockGithubClientAdapter) ListRepositoryBranches ¶
func (*MockGithubClientAdapter) ListRepositoryCollaborators ¶
func (*MockGithubClientAdapter) ListRepositoryHooks ¶
func (*MockGithubClientAdapter) ListRepositoryTopics ¶
Click to show internal directories.
Click to hide internal directories.