Documentation
¶
Overview ¶
The github package exists to provide a client for the GH API, which can also be faked with a mock. In most cases, we want the real client, but testing should mock it, lest we get blocked from their API, or have to configure auth for simple tests.
Index ¶
- Variables
- func Extra(decrypter repository.Decrypter, factory *Factory, ...) repository.Extra
- func Mutate(ctx context.Context, obj runtime.Object) error
- func ParseOwnerRepoGithub(giturl string) (owner string, repo string, err error)
- type Client
- type Commit
- type CommitAuthor
- type CommitFile
- type Factory
- type GithubRepository
- type GithubWebhookRepository
- type MockClient
- func (_m *MockClient) Commits(ctx context.Context, owner string, repository string, path string, ...) ([]Commit, error)
- func (_m *MockClient) CreatePullRequestComment(ctx context.Context, owner string, repository string, number int, body string) error
- func (_m *MockClient) CreateWebhook(ctx context.Context, owner string, repository string, cfg WebhookConfig) (WebhookConfig, error)
- func (_m *MockClient) DeleteWebhook(ctx context.Context, owner string, repository string, webhookID int64) error
- func (_m *MockClient) EXPECT() *MockClient_Expecter
- func (_m *MockClient) EditWebhook(ctx context.Context, owner string, repository string, cfg WebhookConfig) error
- func (_m *MockClient) GetWebhook(ctx context.Context, owner string, repository string, webhookID int64) (WebhookConfig, error)
- func (_m *MockClient) ListPullRequestFiles(ctx context.Context, owner string, repository string, number int) ([]CommitFile, error)
- func (_m *MockClient) ListWebhooks(ctx context.Context, owner string, repository string) ([]WebhookConfig, error)
- type MockClient_Commits_Call
- func (_c *MockClient_Commits_Call) Return(_a0 []Commit, _a1 error) *MockClient_Commits_Call
- func (_c *MockClient_Commits_Call) Run(...) *MockClient_Commits_Call
- func (_c *MockClient_Commits_Call) RunAndReturn(run func(context.Context, string, string, string, string) ([]Commit, error)) *MockClient_Commits_Call
- type MockClient_CreatePullRequestComment_Call
- func (_c *MockClient_CreatePullRequestComment_Call) Return(_a0 error) *MockClient_CreatePullRequestComment_Call
- func (_c *MockClient_CreatePullRequestComment_Call) Run(...) *MockClient_CreatePullRequestComment_Call
- func (_c *MockClient_CreatePullRequestComment_Call) RunAndReturn(run func(context.Context, string, string, int, string) error) *MockClient_CreatePullRequestComment_Call
- type MockClient_CreateWebhook_Call
- type MockClient_DeleteWebhook_Call
- func (_c *MockClient_DeleteWebhook_Call) Return(_a0 error) *MockClient_DeleteWebhook_Call
- func (_c *MockClient_DeleteWebhook_Call) Run(...) *MockClient_DeleteWebhook_Call
- func (_c *MockClient_DeleteWebhook_Call) RunAndReturn(run func(context.Context, string, string, int64) error) *MockClient_DeleteWebhook_Call
- type MockClient_EditWebhook_Call
- func (_c *MockClient_EditWebhook_Call) Return(_a0 error) *MockClient_EditWebhook_Call
- func (_c *MockClient_EditWebhook_Call) Run(...) *MockClient_EditWebhook_Call
- func (_c *MockClient_EditWebhook_Call) RunAndReturn(run func(context.Context, string, string, WebhookConfig) error) *MockClient_EditWebhook_Call
- type MockClient_Expecter
- func (_e *MockClient_Expecter) Commits(ctx interface{}, owner interface{}, repository interface{}, path interface{}, ...) *MockClient_Commits_Call
- func (_e *MockClient_Expecter) CreatePullRequestComment(ctx interface{}, owner interface{}, repository interface{}, number interface{}, ...) *MockClient_CreatePullRequestComment_Call
- func (_e *MockClient_Expecter) CreateWebhook(ctx interface{}, owner interface{}, repository interface{}, cfg interface{}) *MockClient_CreateWebhook_Call
- func (_e *MockClient_Expecter) DeleteWebhook(ctx interface{}, owner interface{}, repository interface{}, ...) *MockClient_DeleteWebhook_Call
- func (_e *MockClient_Expecter) EditWebhook(ctx interface{}, owner interface{}, repository interface{}, cfg interface{}) *MockClient_EditWebhook_Call
- func (_e *MockClient_Expecter) GetWebhook(ctx interface{}, owner interface{}, repository interface{}, ...) *MockClient_GetWebhook_Call
- func (_e *MockClient_Expecter) ListPullRequestFiles(ctx interface{}, owner interface{}, repository interface{}, number interface{}) *MockClient_ListPullRequestFiles_Call
- func (_e *MockClient_Expecter) ListWebhooks(ctx interface{}, owner interface{}, repository interface{}) *MockClient_ListWebhooks_Call
- type MockClient_GetWebhook_Call
- func (_c *MockClient_GetWebhook_Call) Return(_a0 WebhookConfig, _a1 error) *MockClient_GetWebhook_Call
- func (_c *MockClient_GetWebhook_Call) Run(...) *MockClient_GetWebhook_Call
- func (_c *MockClient_GetWebhook_Call) RunAndReturn(run func(context.Context, string, string, int64) (WebhookConfig, error)) *MockClient_GetWebhook_Call
- type MockClient_ListPullRequestFiles_Call
- func (_c *MockClient_ListPullRequestFiles_Call) Return(_a0 []CommitFile, _a1 error) *MockClient_ListPullRequestFiles_Call
- func (_c *MockClient_ListPullRequestFiles_Call) Run(run func(ctx context.Context, owner string, repository string, number int)) *MockClient_ListPullRequestFiles_Call
- func (_c *MockClient_ListPullRequestFiles_Call) RunAndReturn(run func(context.Context, string, string, int) ([]CommitFile, error)) *MockClient_ListPullRequestFiles_Call
- type MockClient_ListWebhooks_Call
- func (_c *MockClient_ListWebhooks_Call) Return(_a0 []WebhookConfig, _a1 error) *MockClient_ListWebhooks_Call
- func (_c *MockClient_ListWebhooks_Call) Run(run func(ctx context.Context, owner string, repository string)) *MockClient_ListWebhooks_Call
- func (_c *MockClient_ListWebhooks_Call) RunAndReturn(run func(context.Context, string, string) ([]WebhookConfig, error)) *MockClient_ListWebhooks_Call
- type MockCommitFile
- type MockCommitFile_Expecter
- func (_e *MockCommitFile_Expecter) GetFilename() *MockCommitFile_GetFilename_Call
- func (_e *MockCommitFile_Expecter) GetPreviousFilename() *MockCommitFile_GetPreviousFilename_Call
- func (_e *MockCommitFile_Expecter) GetSHA() *MockCommitFile_GetSHA_Call
- func (_e *MockCommitFile_Expecter) GetStatus() *MockCommitFile_GetStatus_Call
- type MockCommitFile_GetFilename_Call
- type MockCommitFile_GetPreviousFilename_Call
- func (_c *MockCommitFile_GetPreviousFilename_Call) Return(_a0 string) *MockCommitFile_GetPreviousFilename_Call
- func (_c *MockCommitFile_GetPreviousFilename_Call) Run(run func()) *MockCommitFile_GetPreviousFilename_Call
- func (_c *MockCommitFile_GetPreviousFilename_Call) RunAndReturn(run func() string) *MockCommitFile_GetPreviousFilename_Call
- type MockCommitFile_GetSHA_Call
- type MockCommitFile_GetStatus_Call
- type MockGithubRepository
- func (_m *MockGithubRepository) Client() Client
- func (_m *MockGithubRepository) CompareFiles(ctx context.Context, base string, ref string) ([]repository.VersionedFileChange, error)
- func (_m *MockGithubRepository) Config() *v0alpha1.Repository
- func (_m *MockGithubRepository) Create(ctx context.Context, path string, ref string, data []byte, message string) error
- func (_m *MockGithubRepository) Delete(ctx context.Context, path string, ref string, message string) error
- func (_m *MockGithubRepository) EXPECT() *MockGithubRepository_Expecter
- func (_m *MockGithubRepository) History(ctx context.Context, path string, ref string) ([]v0alpha1.HistoryItem, error)
- func (_m *MockGithubRepository) LatestRef(ctx context.Context) (string, error)
- func (_m *MockGithubRepository) ListRefs(ctx context.Context) ([]v0alpha1.RefItem, error)
- func (_m *MockGithubRepository) Move(ctx context.Context, oldPath string, newPath string, ref string, ...) error
- func (_m *MockGithubRepository) Owner() string
- func (_m *MockGithubRepository) Read(ctx context.Context, path string, ref string) (*repository.FileInfo, error)
- func (_m *MockGithubRepository) ReadTree(ctx context.Context, ref string) ([]repository.FileTreeEntry, error)
- func (_m *MockGithubRepository) RefURLs(ctx context.Context, ref string) (*v0alpha1.RepositoryURLs, error)
- func (_m *MockGithubRepository) Repo() string
- func (_m *MockGithubRepository) ResourceURLs(ctx context.Context, file *repository.FileInfo) (*v0alpha1.RepositoryURLs, error)
- func (_m *MockGithubRepository) Stage(ctx context.Context, opts repository.StageOptions) (repository.StagedRepository, error)
- func (_m *MockGithubRepository) Test(ctx context.Context) (*v0alpha1.TestResults, error)
- func (_m *MockGithubRepository) Update(ctx context.Context, path string, ref string, data []byte, message string) error
- func (_m *MockGithubRepository) Validate() field.ErrorList
- func (_m *MockGithubRepository) Write(ctx context.Context, path string, ref string, data []byte, message string) error
- type MockGithubRepository_Client_Call
- func (_c *MockGithubRepository_Client_Call) Return(_a0 Client) *MockGithubRepository_Client_Call
- func (_c *MockGithubRepository_Client_Call) Run(run func()) *MockGithubRepository_Client_Call
- func (_c *MockGithubRepository_Client_Call) RunAndReturn(run func() Client) *MockGithubRepository_Client_Call
- type MockGithubRepository_CompareFiles_Call
- func (_c *MockGithubRepository_CompareFiles_Call) Return(_a0 []repository.VersionedFileChange, _a1 error) *MockGithubRepository_CompareFiles_Call
- func (_c *MockGithubRepository_CompareFiles_Call) Run(run func(ctx context.Context, base string, ref string)) *MockGithubRepository_CompareFiles_Call
- func (_c *MockGithubRepository_CompareFiles_Call) RunAndReturn(...) *MockGithubRepository_CompareFiles_Call
- type MockGithubRepository_Config_Call
- func (_c *MockGithubRepository_Config_Call) Return(_a0 *v0alpha1.Repository) *MockGithubRepository_Config_Call
- func (_c *MockGithubRepository_Config_Call) Run(run func()) *MockGithubRepository_Config_Call
- func (_c *MockGithubRepository_Config_Call) RunAndReturn(run func() *v0alpha1.Repository) *MockGithubRepository_Config_Call
- type MockGithubRepository_Create_Call
- func (_c *MockGithubRepository_Create_Call) Return(_a0 error) *MockGithubRepository_Create_Call
- func (_c *MockGithubRepository_Create_Call) Run(...) *MockGithubRepository_Create_Call
- func (_c *MockGithubRepository_Create_Call) RunAndReturn(run func(context.Context, string, string, []byte, string) error) *MockGithubRepository_Create_Call
- type MockGithubRepository_Delete_Call
- func (_c *MockGithubRepository_Delete_Call) Return(_a0 error) *MockGithubRepository_Delete_Call
- func (_c *MockGithubRepository_Delete_Call) Run(run func(ctx context.Context, path string, ref string, message string)) *MockGithubRepository_Delete_Call
- func (_c *MockGithubRepository_Delete_Call) RunAndReturn(run func(context.Context, string, string, string) error) *MockGithubRepository_Delete_Call
- type MockGithubRepository_Expecter
- func (_e *MockGithubRepository_Expecter) Client() *MockGithubRepository_Client_Call
- func (_e *MockGithubRepository_Expecter) CompareFiles(ctx interface{}, base interface{}, ref interface{}) *MockGithubRepository_CompareFiles_Call
- func (_e *MockGithubRepository_Expecter) Config() *MockGithubRepository_Config_Call
- func (_e *MockGithubRepository_Expecter) Create(ctx interface{}, path interface{}, ref interface{}, data interface{}, ...) *MockGithubRepository_Create_Call
- func (_e *MockGithubRepository_Expecter) Delete(ctx interface{}, path interface{}, ref interface{}, message interface{}) *MockGithubRepository_Delete_Call
- func (_e *MockGithubRepository_Expecter) History(ctx interface{}, path interface{}, ref interface{}) *MockGithubRepository_History_Call
- func (_e *MockGithubRepository_Expecter) LatestRef(ctx interface{}) *MockGithubRepository_LatestRef_Call
- func (_e *MockGithubRepository_Expecter) ListRefs(ctx interface{}) *MockGithubRepository_ListRefs_Call
- func (_e *MockGithubRepository_Expecter) Move(ctx interface{}, oldPath interface{}, newPath interface{}, ref interface{}, ...) *MockGithubRepository_Move_Call
- func (_e *MockGithubRepository_Expecter) Owner() *MockGithubRepository_Owner_Call
- func (_e *MockGithubRepository_Expecter) Read(ctx interface{}, path interface{}, ref interface{}) *MockGithubRepository_Read_Call
- func (_e *MockGithubRepository_Expecter) ReadTree(ctx interface{}, ref interface{}) *MockGithubRepository_ReadTree_Call
- func (_e *MockGithubRepository_Expecter) RefURLs(ctx interface{}, ref interface{}) *MockGithubRepository_RefURLs_Call
- func (_e *MockGithubRepository_Expecter) Repo() *MockGithubRepository_Repo_Call
- func (_e *MockGithubRepository_Expecter) ResourceURLs(ctx interface{}, file interface{}) *MockGithubRepository_ResourceURLs_Call
- func (_e *MockGithubRepository_Expecter) Stage(ctx interface{}, opts interface{}) *MockGithubRepository_Stage_Call
- func (_e *MockGithubRepository_Expecter) Test(ctx interface{}) *MockGithubRepository_Test_Call
- func (_e *MockGithubRepository_Expecter) Update(ctx interface{}, path interface{}, ref interface{}, data interface{}, ...) *MockGithubRepository_Update_Call
- func (_e *MockGithubRepository_Expecter) Validate() *MockGithubRepository_Validate_Call
- func (_e *MockGithubRepository_Expecter) Write(ctx interface{}, path interface{}, ref interface{}, data interface{}, ...) *MockGithubRepository_Write_Call
- type MockGithubRepository_History_Call
- func (_c *MockGithubRepository_History_Call) Return(_a0 []v0alpha1.HistoryItem, _a1 error) *MockGithubRepository_History_Call
- func (_c *MockGithubRepository_History_Call) Run(run func(ctx context.Context, path string, ref string)) *MockGithubRepository_History_Call
- func (_c *MockGithubRepository_History_Call) RunAndReturn(run func(context.Context, string, string) ([]v0alpha1.HistoryItem, error)) *MockGithubRepository_History_Call
- type MockGithubRepository_LatestRef_Call
- func (_c *MockGithubRepository_LatestRef_Call) Return(_a0 string, _a1 error) *MockGithubRepository_LatestRef_Call
- func (_c *MockGithubRepository_LatestRef_Call) Run(run func(ctx context.Context)) *MockGithubRepository_LatestRef_Call
- func (_c *MockGithubRepository_LatestRef_Call) RunAndReturn(run func(context.Context) (string, error)) *MockGithubRepository_LatestRef_Call
- type MockGithubRepository_ListRefs_Call
- func (_c *MockGithubRepository_ListRefs_Call) Return(_a0 []v0alpha1.RefItem, _a1 error) *MockGithubRepository_ListRefs_Call
- func (_c *MockGithubRepository_ListRefs_Call) Run(run func(ctx context.Context)) *MockGithubRepository_ListRefs_Call
- func (_c *MockGithubRepository_ListRefs_Call) RunAndReturn(run func(context.Context) ([]v0alpha1.RefItem, error)) *MockGithubRepository_ListRefs_Call
- type MockGithubRepository_Move_Call
- func (_c *MockGithubRepository_Move_Call) Return(_a0 error) *MockGithubRepository_Move_Call
- func (_c *MockGithubRepository_Move_Call) Run(run func(ctx context.Context, oldPath string, newPath string, ref string, ...)) *MockGithubRepository_Move_Call
- func (_c *MockGithubRepository_Move_Call) RunAndReturn(run func(context.Context, string, string, string, string) error) *MockGithubRepository_Move_Call
- type MockGithubRepository_Owner_Call
- type MockGithubRepository_ReadTree_Call
- func (_c *MockGithubRepository_ReadTree_Call) Return(_a0 []repository.FileTreeEntry, _a1 error) *MockGithubRepository_ReadTree_Call
- func (_c *MockGithubRepository_ReadTree_Call) Run(run func(ctx context.Context, ref string)) *MockGithubRepository_ReadTree_Call
- func (_c *MockGithubRepository_ReadTree_Call) RunAndReturn(run func(context.Context, string) ([]repository.FileTreeEntry, error)) *MockGithubRepository_ReadTree_Call
- type MockGithubRepository_Read_Call
- func (_c *MockGithubRepository_Read_Call) Return(_a0 *repository.FileInfo, _a1 error) *MockGithubRepository_Read_Call
- func (_c *MockGithubRepository_Read_Call) Run(run func(ctx context.Context, path string, ref string)) *MockGithubRepository_Read_Call
- func (_c *MockGithubRepository_Read_Call) RunAndReturn(run func(context.Context, string, string) (*repository.FileInfo, error)) *MockGithubRepository_Read_Call
- type MockGithubRepository_RefURLs_Call
- func (_c *MockGithubRepository_RefURLs_Call) Return(_a0 *v0alpha1.RepositoryURLs, _a1 error) *MockGithubRepository_RefURLs_Call
- func (_c *MockGithubRepository_RefURLs_Call) Run(run func(ctx context.Context, ref string)) *MockGithubRepository_RefURLs_Call
- func (_c *MockGithubRepository_RefURLs_Call) RunAndReturn(run func(context.Context, string) (*v0alpha1.RepositoryURLs, error)) *MockGithubRepository_RefURLs_Call
- type MockGithubRepository_Repo_Call
- type MockGithubRepository_ResourceURLs_Call
- func (_c *MockGithubRepository_ResourceURLs_Call) Return(_a0 *v0alpha1.RepositoryURLs, _a1 error) *MockGithubRepository_ResourceURLs_Call
- func (_c *MockGithubRepository_ResourceURLs_Call) Run(run func(ctx context.Context, file *repository.FileInfo)) *MockGithubRepository_ResourceURLs_Call
- func (_c *MockGithubRepository_ResourceURLs_Call) RunAndReturn(...) *MockGithubRepository_ResourceURLs_Call
- type MockGithubRepository_Stage_Call
- func (_c *MockGithubRepository_Stage_Call) Return(_a0 repository.StagedRepository, _a1 error) *MockGithubRepository_Stage_Call
- func (_c *MockGithubRepository_Stage_Call) Run(run func(ctx context.Context, opts repository.StageOptions)) *MockGithubRepository_Stage_Call
- func (_c *MockGithubRepository_Stage_Call) RunAndReturn(...) *MockGithubRepository_Stage_Call
- type MockGithubRepository_Test_Call
- func (_c *MockGithubRepository_Test_Call) Return(_a0 *v0alpha1.TestResults, _a1 error) *MockGithubRepository_Test_Call
- func (_c *MockGithubRepository_Test_Call) Run(run func(ctx context.Context)) *MockGithubRepository_Test_Call
- func (_c *MockGithubRepository_Test_Call) RunAndReturn(run func(context.Context) (*v0alpha1.TestResults, error)) *MockGithubRepository_Test_Call
- type MockGithubRepository_Update_Call
- func (_c *MockGithubRepository_Update_Call) Return(_a0 error) *MockGithubRepository_Update_Call
- func (_c *MockGithubRepository_Update_Call) Run(...) *MockGithubRepository_Update_Call
- func (_c *MockGithubRepository_Update_Call) RunAndReturn(run func(context.Context, string, string, []byte, string) error) *MockGithubRepository_Update_Call
- type MockGithubRepository_Validate_Call
- func (_c *MockGithubRepository_Validate_Call) Return(_a0 field.ErrorList) *MockGithubRepository_Validate_Call
- func (_c *MockGithubRepository_Validate_Call) Run(run func()) *MockGithubRepository_Validate_Call
- func (_c *MockGithubRepository_Validate_Call) RunAndReturn(run func() field.ErrorList) *MockGithubRepository_Validate_Call
- type MockGithubRepository_Write_Call
- func (_c *MockGithubRepository_Write_Call) Return(_a0 error) *MockGithubRepository_Write_Call
- func (_c *MockGithubRepository_Write_Call) Run(...) *MockGithubRepository_Write_Call
- func (_c *MockGithubRepository_Write_Call) RunAndReturn(run func(context.Context, string, string, []byte, string) error) *MockGithubRepository_Write_Call
- type WebhookConfig
- type WebhookRepository
- type WebhookURLBuilder
Constants ¶
This section is empty.
Variables ¶
var ( ErrResourceNotFound = errors.New("the resource does not exist") //lint:ignore ST1005 this is not punctuation ErrTooManyItems = errors.New("maximum number of items exceeded") )
API errors that we need to convey after parsing real GH errors (or faking them).
Functions ¶
func Extra ¶
func Extra(decrypter repository.Decrypter, factory *Factory, webhookBuilder WebhookURLBuilder) repository.Extra
Types ¶
type Client ¶
type Client interface {
// Commits
Commits(ctx context.Context, owner, repository, path, branch string) ([]Commit, error)
// Webhooks
ListWebhooks(ctx context.Context, owner, repository string) ([]WebhookConfig, error)
CreateWebhook(ctx context.Context, owner, repository string, cfg WebhookConfig) (WebhookConfig, error)
GetWebhook(ctx context.Context, owner, repository string, webhookID int64) (WebhookConfig, error)
DeleteWebhook(ctx context.Context, owner, repository string, webhookID int64) error
EditWebhook(ctx context.Context, owner, repository string, cfg WebhookConfig) error
// Pull requests
ListPullRequestFiles(ctx context.Context, owner, repository string, number int) ([]CommitFile, error)
CreatePullRequestComment(ctx context.Context, owner, repository string, number int, body string) error
}
type Commit ¶
type Commit struct {
Ref string
Message string
Author *CommitAuthor
Committer *CommitAuthor
CreatedAt time.Time
}
type CommitAuthor ¶
type CommitFile ¶
type Factory ¶
type Factory struct {
// Client allows overriding the client to use in the GH client returned. It exists primarily for testing.
// FIXME: we should replace in this way. We should add some options pattern for the factory.
Client *http.Client
}
Factory creates new GitHub clients. It exists only for the ability to test the code easily.
func ProvideFactory ¶
func ProvideFactory() *Factory
type GithubRepository ¶
type GithubRepository interface {
repository.Repository
repository.Versioned
repository.Writer
repository.Reader
repository.RepositoryWithURLs
repository.StageableRepository
Owner() string
Repo() string
Client() Client
}
func NewRepository ¶
func NewRepository( ctx context.Context, config *provisioning.Repository, gitRepo git.GitRepository, factory *Factory, token common.RawSecureValue, ) (GithubRepository, error)
type GithubWebhookRepository ¶
type GithubWebhookRepository interface {
GithubRepository
repository.Hooks
WebhookRepository
}
func NewGithubWebhookRepository ¶
func NewGithubWebhookRepository( basic GithubRepository, webhookURL string, secret common.RawSecureValue, ) GithubWebhookRepository
type MockClient ¶
MockClient is an autogenerated mock type for the Client type
func NewMockClient ¶
func NewMockClient(t interface {
mock.TestingT
Cleanup(func())
}) *MockClient
NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockClient) Commits ¶
func (_m *MockClient) Commits(ctx context.Context, owner string, repository string, path string, branch string) ([]Commit, error)
Commits provides a mock function with given fields: ctx, owner, repository, path, branch
func (*MockClient) CreatePullRequestComment ¶
func (_m *MockClient) CreatePullRequestComment(ctx context.Context, owner string, repository string, number int, body string) error
CreatePullRequestComment provides a mock function with given fields: ctx, owner, repository, number, body
func (*MockClient) CreateWebhook ¶
func (_m *MockClient) CreateWebhook(ctx context.Context, owner string, repository string, cfg WebhookConfig) (WebhookConfig, error)
CreateWebhook provides a mock function with given fields: ctx, owner, repository, cfg
func (*MockClient) DeleteWebhook ¶
func (_m *MockClient) DeleteWebhook(ctx context.Context, owner string, repository string, webhookID int64) error
DeleteWebhook provides a mock function with given fields: ctx, owner, repository, webhookID
func (*MockClient) EXPECT ¶
func (_m *MockClient) EXPECT() *MockClient_Expecter
func (*MockClient) EditWebhook ¶
func (_m *MockClient) EditWebhook(ctx context.Context, owner string, repository string, cfg WebhookConfig) error
EditWebhook provides a mock function with given fields: ctx, owner, repository, cfg
func (*MockClient) GetWebhook ¶
func (_m *MockClient) GetWebhook(ctx context.Context, owner string, repository string, webhookID int64) (WebhookConfig, error)
GetWebhook provides a mock function with given fields: ctx, owner, repository, webhookID
func (*MockClient) ListPullRequestFiles ¶
func (_m *MockClient) ListPullRequestFiles(ctx context.Context, owner string, repository string, number int) ([]CommitFile, error)
ListPullRequestFiles provides a mock function with given fields: ctx, owner, repository, number
func (*MockClient) ListWebhooks ¶
func (_m *MockClient) ListWebhooks(ctx context.Context, owner string, repository string) ([]WebhookConfig, error)
ListWebhooks provides a mock function with given fields: ctx, owner, repository
type MockClient_Commits_Call ¶
MockClient_Commits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commits'
func (*MockClient_Commits_Call) Return ¶
func (_c *MockClient_Commits_Call) Return(_a0 []Commit, _a1 error) *MockClient_Commits_Call
func (*MockClient_Commits_Call) Run ¶
func (_c *MockClient_Commits_Call) Run(run func(ctx context.Context, owner string, repository string, path string, branch string)) *MockClient_Commits_Call
func (*MockClient_Commits_Call) RunAndReturn ¶
func (_c *MockClient_Commits_Call) RunAndReturn(run func(context.Context, string, string, string, string) ([]Commit, error)) *MockClient_Commits_Call
type MockClient_CreatePullRequestComment_Call ¶
MockClient_CreatePullRequestComment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreatePullRequestComment'
func (*MockClient_CreatePullRequestComment_Call) Return ¶
func (_c *MockClient_CreatePullRequestComment_Call) Return(_a0 error) *MockClient_CreatePullRequestComment_Call
func (*MockClient_CreatePullRequestComment_Call) Run ¶
func (_c *MockClient_CreatePullRequestComment_Call) Run(run func(ctx context.Context, owner string, repository string, number int, body string)) *MockClient_CreatePullRequestComment_Call
func (*MockClient_CreatePullRequestComment_Call) RunAndReturn ¶
func (_c *MockClient_CreatePullRequestComment_Call) RunAndReturn(run func(context.Context, string, string, int, string) error) *MockClient_CreatePullRequestComment_Call
type MockClient_CreateWebhook_Call ¶
MockClient_CreateWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateWebhook'
func (*MockClient_CreateWebhook_Call) Return ¶
func (_c *MockClient_CreateWebhook_Call) Return(_a0 WebhookConfig, _a1 error) *MockClient_CreateWebhook_Call
func (*MockClient_CreateWebhook_Call) Run ¶
func (_c *MockClient_CreateWebhook_Call) Run(run func(ctx context.Context, owner string, repository string, cfg WebhookConfig)) *MockClient_CreateWebhook_Call
func (*MockClient_CreateWebhook_Call) RunAndReturn ¶
func (_c *MockClient_CreateWebhook_Call) RunAndReturn(run func(context.Context, string, string, WebhookConfig) (WebhookConfig, error)) *MockClient_CreateWebhook_Call
type MockClient_DeleteWebhook_Call ¶
MockClient_DeleteWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteWebhook'
func (*MockClient_DeleteWebhook_Call) Return ¶
func (_c *MockClient_DeleteWebhook_Call) Return(_a0 error) *MockClient_DeleteWebhook_Call
func (*MockClient_DeleteWebhook_Call) Run ¶
func (_c *MockClient_DeleteWebhook_Call) Run(run func(ctx context.Context, owner string, repository string, webhookID int64)) *MockClient_DeleteWebhook_Call
func (*MockClient_DeleteWebhook_Call) RunAndReturn ¶
func (_c *MockClient_DeleteWebhook_Call) RunAndReturn(run func(context.Context, string, string, int64) error) *MockClient_DeleteWebhook_Call
type MockClient_EditWebhook_Call ¶
MockClient_EditWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EditWebhook'
func (*MockClient_EditWebhook_Call) Return ¶
func (_c *MockClient_EditWebhook_Call) Return(_a0 error) *MockClient_EditWebhook_Call
func (*MockClient_EditWebhook_Call) Run ¶
func (_c *MockClient_EditWebhook_Call) Run(run func(ctx context.Context, owner string, repository string, cfg WebhookConfig)) *MockClient_EditWebhook_Call
func (*MockClient_EditWebhook_Call) RunAndReturn ¶
func (_c *MockClient_EditWebhook_Call) RunAndReturn(run func(context.Context, string, string, WebhookConfig) error) *MockClient_EditWebhook_Call
type MockClient_Expecter ¶
type MockClient_Expecter struct {
// contains filtered or unexported fields
}
func (*MockClient_Expecter) Commits ¶
func (_e *MockClient_Expecter) Commits(ctx interface{}, owner interface{}, repository interface{}, path interface{}, branch interface{}) *MockClient_Commits_Call
Commits is a helper method to define mock.On call
- ctx context.Context
- owner string
- repository string
- path string
- branch string
func (*MockClient_Expecter) CreatePullRequestComment ¶
func (_e *MockClient_Expecter) CreatePullRequestComment(ctx interface{}, owner interface{}, repository interface{}, number interface{}, body interface{}) *MockClient_CreatePullRequestComment_Call
CreatePullRequestComment is a helper method to define mock.On call
- ctx context.Context
- owner string
- repository string
- number int
- body string
func (*MockClient_Expecter) CreateWebhook ¶
func (_e *MockClient_Expecter) CreateWebhook(ctx interface{}, owner interface{}, repository interface{}, cfg interface{}) *MockClient_CreateWebhook_Call
CreateWebhook is a helper method to define mock.On call
- ctx context.Context
- owner string
- repository string
- cfg WebhookConfig
func (*MockClient_Expecter) DeleteWebhook ¶
func (_e *MockClient_Expecter) DeleteWebhook(ctx interface{}, owner interface{}, repository interface{}, webhookID interface{}) *MockClient_DeleteWebhook_Call
DeleteWebhook is a helper method to define mock.On call
- ctx context.Context
- owner string
- repository string
- webhookID int64
func (*MockClient_Expecter) EditWebhook ¶
func (_e *MockClient_Expecter) EditWebhook(ctx interface{}, owner interface{}, repository interface{}, cfg interface{}) *MockClient_EditWebhook_Call
EditWebhook is a helper method to define mock.On call
- ctx context.Context
- owner string
- repository string
- cfg WebhookConfig
func (*MockClient_Expecter) GetWebhook ¶
func (_e *MockClient_Expecter) GetWebhook(ctx interface{}, owner interface{}, repository interface{}, webhookID interface{}) *MockClient_GetWebhook_Call
GetWebhook is a helper method to define mock.On call
- ctx context.Context
- owner string
- repository string
- webhookID int64
func (*MockClient_Expecter) ListPullRequestFiles ¶
func (_e *MockClient_Expecter) ListPullRequestFiles(ctx interface{}, owner interface{}, repository interface{}, number interface{}) *MockClient_ListPullRequestFiles_Call
ListPullRequestFiles is a helper method to define mock.On call
- ctx context.Context
- owner string
- repository string
- number int
func (*MockClient_Expecter) ListWebhooks ¶
func (_e *MockClient_Expecter) ListWebhooks(ctx interface{}, owner interface{}, repository interface{}) *MockClient_ListWebhooks_Call
ListWebhooks is a helper method to define mock.On call
- ctx context.Context
- owner string
- repository string
type MockClient_GetWebhook_Call ¶
MockClient_GetWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWebhook'
func (*MockClient_GetWebhook_Call) Return ¶
func (_c *MockClient_GetWebhook_Call) Return(_a0 WebhookConfig, _a1 error) *MockClient_GetWebhook_Call
func (*MockClient_GetWebhook_Call) Run ¶
func (_c *MockClient_GetWebhook_Call) Run(run func(ctx context.Context, owner string, repository string, webhookID int64)) *MockClient_GetWebhook_Call
func (*MockClient_GetWebhook_Call) RunAndReturn ¶
func (_c *MockClient_GetWebhook_Call) RunAndReturn(run func(context.Context, string, string, int64) (WebhookConfig, error)) *MockClient_GetWebhook_Call
type MockClient_ListPullRequestFiles_Call ¶
MockClient_ListPullRequestFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPullRequestFiles'
func (*MockClient_ListPullRequestFiles_Call) Return ¶
func (_c *MockClient_ListPullRequestFiles_Call) Return(_a0 []CommitFile, _a1 error) *MockClient_ListPullRequestFiles_Call
func (*MockClient_ListPullRequestFiles_Call) Run ¶
func (_c *MockClient_ListPullRequestFiles_Call) Run(run func(ctx context.Context, owner string, repository string, number int)) *MockClient_ListPullRequestFiles_Call
func (*MockClient_ListPullRequestFiles_Call) RunAndReturn ¶
func (_c *MockClient_ListPullRequestFiles_Call) RunAndReturn(run func(context.Context, string, string, int) ([]CommitFile, error)) *MockClient_ListPullRequestFiles_Call
type MockClient_ListWebhooks_Call ¶
MockClient_ListWebhooks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListWebhooks'
func (*MockClient_ListWebhooks_Call) Return ¶
func (_c *MockClient_ListWebhooks_Call) Return(_a0 []WebhookConfig, _a1 error) *MockClient_ListWebhooks_Call
func (*MockClient_ListWebhooks_Call) Run ¶
func (_c *MockClient_ListWebhooks_Call) Run(run func(ctx context.Context, owner string, repository string)) *MockClient_ListWebhooks_Call
func (*MockClient_ListWebhooks_Call) RunAndReturn ¶
func (_c *MockClient_ListWebhooks_Call) RunAndReturn(run func(context.Context, string, string) ([]WebhookConfig, error)) *MockClient_ListWebhooks_Call
type MockCommitFile ¶
MockCommitFile is an autogenerated mock type for the CommitFile type
func NewMockCommitFile ¶
func NewMockCommitFile(t interface {
mock.TestingT
Cleanup(func())
}) *MockCommitFile
NewMockCommitFile creates a new instance of MockCommitFile. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockCommitFile) EXPECT ¶
func (_m *MockCommitFile) EXPECT() *MockCommitFile_Expecter
func (*MockCommitFile) GetFilename ¶
func (_m *MockCommitFile) GetFilename() string
GetFilename provides a mock function with no fields
func (*MockCommitFile) GetPreviousFilename ¶
func (_m *MockCommitFile) GetPreviousFilename() string
GetPreviousFilename provides a mock function with no fields
func (*MockCommitFile) GetSHA ¶
func (_m *MockCommitFile) GetSHA() string
GetSHA provides a mock function with no fields
func (*MockCommitFile) GetStatus ¶
func (_m *MockCommitFile) GetStatus() string
GetStatus provides a mock function with no fields
type MockCommitFile_Expecter ¶
type MockCommitFile_Expecter struct {
// contains filtered or unexported fields
}
func (*MockCommitFile_Expecter) GetFilename ¶
func (_e *MockCommitFile_Expecter) GetFilename() *MockCommitFile_GetFilename_Call
GetFilename is a helper method to define mock.On call
func (*MockCommitFile_Expecter) GetPreviousFilename ¶
func (_e *MockCommitFile_Expecter) GetPreviousFilename() *MockCommitFile_GetPreviousFilename_Call
GetPreviousFilename is a helper method to define mock.On call
func (*MockCommitFile_Expecter) GetSHA ¶
func (_e *MockCommitFile_Expecter) GetSHA() *MockCommitFile_GetSHA_Call
GetSHA is a helper method to define mock.On call
func (*MockCommitFile_Expecter) GetStatus ¶
func (_e *MockCommitFile_Expecter) GetStatus() *MockCommitFile_GetStatus_Call
GetStatus is a helper method to define mock.On call
type MockCommitFile_GetFilename_Call ¶
MockCommitFile_GetFilename_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFilename'
func (*MockCommitFile_GetFilename_Call) Return ¶
func (_c *MockCommitFile_GetFilename_Call) Return(_a0 string) *MockCommitFile_GetFilename_Call
func (*MockCommitFile_GetFilename_Call) Run ¶
func (_c *MockCommitFile_GetFilename_Call) Run(run func()) *MockCommitFile_GetFilename_Call
func (*MockCommitFile_GetFilename_Call) RunAndReturn ¶
func (_c *MockCommitFile_GetFilename_Call) RunAndReturn(run func() string) *MockCommitFile_GetFilename_Call
type MockCommitFile_GetPreviousFilename_Call ¶
MockCommitFile_GetPreviousFilename_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPreviousFilename'
func (*MockCommitFile_GetPreviousFilename_Call) Return ¶
func (_c *MockCommitFile_GetPreviousFilename_Call) Return(_a0 string) *MockCommitFile_GetPreviousFilename_Call
func (*MockCommitFile_GetPreviousFilename_Call) Run ¶
func (_c *MockCommitFile_GetPreviousFilename_Call) Run(run func()) *MockCommitFile_GetPreviousFilename_Call
func (*MockCommitFile_GetPreviousFilename_Call) RunAndReturn ¶
func (_c *MockCommitFile_GetPreviousFilename_Call) RunAndReturn(run func() string) *MockCommitFile_GetPreviousFilename_Call
type MockCommitFile_GetSHA_Call ¶
MockCommitFile_GetSHA_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSHA'
func (*MockCommitFile_GetSHA_Call) Return ¶
func (_c *MockCommitFile_GetSHA_Call) Return(_a0 string) *MockCommitFile_GetSHA_Call
func (*MockCommitFile_GetSHA_Call) Run ¶
func (_c *MockCommitFile_GetSHA_Call) Run(run func()) *MockCommitFile_GetSHA_Call
func (*MockCommitFile_GetSHA_Call) RunAndReturn ¶
func (_c *MockCommitFile_GetSHA_Call) RunAndReturn(run func() string) *MockCommitFile_GetSHA_Call
type MockCommitFile_GetStatus_Call ¶
MockCommitFile_GetStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStatus'
func (*MockCommitFile_GetStatus_Call) Return ¶
func (_c *MockCommitFile_GetStatus_Call) Return(_a0 string) *MockCommitFile_GetStatus_Call
func (*MockCommitFile_GetStatus_Call) Run ¶
func (_c *MockCommitFile_GetStatus_Call) Run(run func()) *MockCommitFile_GetStatus_Call
func (*MockCommitFile_GetStatus_Call) RunAndReturn ¶
func (_c *MockCommitFile_GetStatus_Call) RunAndReturn(run func() string) *MockCommitFile_GetStatus_Call
type MockGithubRepository ¶
MockGithubRepository is an autogenerated mock type for the GithubRepository type
func NewMockGithubRepository ¶
func NewMockGithubRepository(t interface {
mock.TestingT
Cleanup(func())
}) *MockGithubRepository
NewMockGithubRepository creates a new instance of MockGithubRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockGithubRepository) Client ¶
func (_m *MockGithubRepository) Client() Client
Client provides a mock function with no fields
func (*MockGithubRepository) CompareFiles ¶
func (_m *MockGithubRepository) CompareFiles(ctx context.Context, base string, ref string) ([]repository.VersionedFileChange, error)
CompareFiles provides a mock function with given fields: ctx, base, ref
func (*MockGithubRepository) Config ¶
func (_m *MockGithubRepository) Config() *v0alpha1.Repository
Config provides a mock function with no fields
func (*MockGithubRepository) Create ¶
func (_m *MockGithubRepository) Create(ctx context.Context, path string, ref string, data []byte, message string) error
Create provides a mock function with given fields: ctx, path, ref, data, message
func (*MockGithubRepository) Delete ¶
func (_m *MockGithubRepository) Delete(ctx context.Context, path string, ref string, message string) error
Delete provides a mock function with given fields: ctx, path, ref, message
func (*MockGithubRepository) EXPECT ¶
func (_m *MockGithubRepository) EXPECT() *MockGithubRepository_Expecter
func (*MockGithubRepository) History ¶
func (_m *MockGithubRepository) History(ctx context.Context, path string, ref string) ([]v0alpha1.HistoryItem, error)
History provides a mock function with given fields: ctx, path, ref
func (*MockGithubRepository) LatestRef ¶
func (_m *MockGithubRepository) LatestRef(ctx context.Context) (string, error)
LatestRef provides a mock function with given fields: ctx
func (*MockGithubRepository) Move ¶
func (_m *MockGithubRepository) Move(ctx context.Context, oldPath string, newPath string, ref string, message string) error
Move provides a mock function with given fields: ctx, oldPath, newPath, ref, message
func (*MockGithubRepository) Owner ¶
func (_m *MockGithubRepository) Owner() string
Owner provides a mock function with no fields
func (*MockGithubRepository) Read ¶
func (_m *MockGithubRepository) Read(ctx context.Context, path string, ref string) (*repository.FileInfo, error)
Read provides a mock function with given fields: ctx, path, ref
func (*MockGithubRepository) ReadTree ¶
func (_m *MockGithubRepository) ReadTree(ctx context.Context, ref string) ([]repository.FileTreeEntry, error)
ReadTree provides a mock function with given fields: ctx, ref
func (*MockGithubRepository) RefURLs ¶
func (_m *MockGithubRepository) RefURLs(ctx context.Context, ref string) (*v0alpha1.RepositoryURLs, error)
RefURLs provides a mock function with given fields: ctx, ref
func (*MockGithubRepository) Repo ¶
func (_m *MockGithubRepository) Repo() string
Repo provides a mock function with no fields
func (*MockGithubRepository) ResourceURLs ¶
func (_m *MockGithubRepository) ResourceURLs(ctx context.Context, file *repository.FileInfo) (*v0alpha1.RepositoryURLs, error)
ResourceURLs provides a mock function with given fields: ctx, file
func (*MockGithubRepository) Stage ¶
func (_m *MockGithubRepository) Stage(ctx context.Context, opts repository.StageOptions) (repository.StagedRepository, error)
Stage provides a mock function with given fields: ctx, opts
func (*MockGithubRepository) Test ¶
func (_m *MockGithubRepository) Test(ctx context.Context) (*v0alpha1.TestResults, error)
Test provides a mock function with given fields: ctx
func (*MockGithubRepository) Update ¶
func (_m *MockGithubRepository) Update(ctx context.Context, path string, ref string, data []byte, message string) error
Update provides a mock function with given fields: ctx, path, ref, data, message
func (*MockGithubRepository) Validate ¶
func (_m *MockGithubRepository) Validate() field.ErrorList
Validate provides a mock function with no fields
type MockGithubRepository_Client_Call ¶
MockGithubRepository_Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Client'
func (*MockGithubRepository_Client_Call) Return ¶
func (_c *MockGithubRepository_Client_Call) Return(_a0 Client) *MockGithubRepository_Client_Call
func (*MockGithubRepository_Client_Call) Run ¶
func (_c *MockGithubRepository_Client_Call) Run(run func()) *MockGithubRepository_Client_Call
func (*MockGithubRepository_Client_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Client_Call) RunAndReturn(run func() Client) *MockGithubRepository_Client_Call
type MockGithubRepository_CompareFiles_Call ¶
MockGithubRepository_CompareFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompareFiles'
func (*MockGithubRepository_CompareFiles_Call) Return ¶
func (_c *MockGithubRepository_CompareFiles_Call) Return(_a0 []repository.VersionedFileChange, _a1 error) *MockGithubRepository_CompareFiles_Call
func (*MockGithubRepository_CompareFiles_Call) Run ¶
func (_c *MockGithubRepository_CompareFiles_Call) Run(run func(ctx context.Context, base string, ref string)) *MockGithubRepository_CompareFiles_Call
func (*MockGithubRepository_CompareFiles_Call) RunAndReturn ¶
func (_c *MockGithubRepository_CompareFiles_Call) RunAndReturn(run func(context.Context, string, string) ([]repository.VersionedFileChange, error)) *MockGithubRepository_CompareFiles_Call
type MockGithubRepository_Config_Call ¶
MockGithubRepository_Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Config'
func (*MockGithubRepository_Config_Call) Return ¶
func (_c *MockGithubRepository_Config_Call) Return(_a0 *v0alpha1.Repository) *MockGithubRepository_Config_Call
func (*MockGithubRepository_Config_Call) Run ¶
func (_c *MockGithubRepository_Config_Call) Run(run func()) *MockGithubRepository_Config_Call
func (*MockGithubRepository_Config_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Config_Call) RunAndReturn(run func() *v0alpha1.Repository) *MockGithubRepository_Config_Call
type MockGithubRepository_Create_Call ¶
MockGithubRepository_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockGithubRepository_Create_Call) Return ¶
func (_c *MockGithubRepository_Create_Call) Return(_a0 error) *MockGithubRepository_Create_Call
func (*MockGithubRepository_Create_Call) Run ¶
func (_c *MockGithubRepository_Create_Call) Run(run func(ctx context.Context, path string, ref string, data []byte, message string)) *MockGithubRepository_Create_Call
func (*MockGithubRepository_Create_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Create_Call) RunAndReturn(run func(context.Context, string, string, []byte, string) error) *MockGithubRepository_Create_Call
type MockGithubRepository_Delete_Call ¶
MockGithubRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
func (*MockGithubRepository_Delete_Call) Return ¶
func (_c *MockGithubRepository_Delete_Call) Return(_a0 error) *MockGithubRepository_Delete_Call
func (*MockGithubRepository_Delete_Call) Run ¶
func (_c *MockGithubRepository_Delete_Call) Run(run func(ctx context.Context, path string, ref string, message string)) *MockGithubRepository_Delete_Call
func (*MockGithubRepository_Delete_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Delete_Call) RunAndReturn(run func(context.Context, string, string, string) error) *MockGithubRepository_Delete_Call
type MockGithubRepository_Expecter ¶
type MockGithubRepository_Expecter struct {
// contains filtered or unexported fields
}
func (*MockGithubRepository_Expecter) Client ¶
func (_e *MockGithubRepository_Expecter) Client() *MockGithubRepository_Client_Call
Client is a helper method to define mock.On call
func (*MockGithubRepository_Expecter) CompareFiles ¶
func (_e *MockGithubRepository_Expecter) CompareFiles(ctx interface{}, base interface{}, ref interface{}) *MockGithubRepository_CompareFiles_Call
CompareFiles is a helper method to define mock.On call
- ctx context.Context
- base string
- ref string
func (*MockGithubRepository_Expecter) Config ¶
func (_e *MockGithubRepository_Expecter) Config() *MockGithubRepository_Config_Call
Config is a helper method to define mock.On call
func (*MockGithubRepository_Expecter) Create ¶
func (_e *MockGithubRepository_Expecter) Create(ctx interface{}, path interface{}, ref interface{}, data interface{}, message interface{}) *MockGithubRepository_Create_Call
Create is a helper method to define mock.On call
- ctx context.Context
- path string
- ref string
- data []byte
- message string
func (*MockGithubRepository_Expecter) Delete ¶
func (_e *MockGithubRepository_Expecter) Delete(ctx interface{}, path interface{}, ref interface{}, message interface{}) *MockGithubRepository_Delete_Call
Delete is a helper method to define mock.On call
- ctx context.Context
- path string
- ref string
- message string
func (*MockGithubRepository_Expecter) History ¶
func (_e *MockGithubRepository_Expecter) History(ctx interface{}, path interface{}, ref interface{}) *MockGithubRepository_History_Call
History is a helper method to define mock.On call
- ctx context.Context
- path string
- ref string
func (*MockGithubRepository_Expecter) LatestRef ¶
func (_e *MockGithubRepository_Expecter) LatestRef(ctx interface{}) *MockGithubRepository_LatestRef_Call
LatestRef is a helper method to define mock.On call
- ctx context.Context
func (*MockGithubRepository_Expecter) ListRefs ¶
func (_e *MockGithubRepository_Expecter) ListRefs(ctx interface{}) *MockGithubRepository_ListRefs_Call
ListRefs is a helper method to define mock.On call
- ctx context.Context
func (*MockGithubRepository_Expecter) Move ¶
func (_e *MockGithubRepository_Expecter) Move(ctx interface{}, oldPath interface{}, newPath interface{}, ref interface{}, message interface{}) *MockGithubRepository_Move_Call
Move is a helper method to define mock.On call
- ctx context.Context
- oldPath string
- newPath string
- ref string
- message string
func (*MockGithubRepository_Expecter) Owner ¶
func (_e *MockGithubRepository_Expecter) Owner() *MockGithubRepository_Owner_Call
Owner is a helper method to define mock.On call
func (*MockGithubRepository_Expecter) Read ¶
func (_e *MockGithubRepository_Expecter) Read(ctx interface{}, path interface{}, ref interface{}) *MockGithubRepository_Read_Call
Read is a helper method to define mock.On call
- ctx context.Context
- path string
- ref string
func (*MockGithubRepository_Expecter) ReadTree ¶
func (_e *MockGithubRepository_Expecter) ReadTree(ctx interface{}, ref interface{}) *MockGithubRepository_ReadTree_Call
ReadTree is a helper method to define mock.On call
- ctx context.Context
- ref string
func (*MockGithubRepository_Expecter) RefURLs ¶
func (_e *MockGithubRepository_Expecter) RefURLs(ctx interface{}, ref interface{}) *MockGithubRepository_RefURLs_Call
RefURLs is a helper method to define mock.On call
- ctx context.Context
- ref string
func (*MockGithubRepository_Expecter) Repo ¶
func (_e *MockGithubRepository_Expecter) Repo() *MockGithubRepository_Repo_Call
Repo is a helper method to define mock.On call
func (*MockGithubRepository_Expecter) ResourceURLs ¶
func (_e *MockGithubRepository_Expecter) ResourceURLs(ctx interface{}, file interface{}) *MockGithubRepository_ResourceURLs_Call
ResourceURLs is a helper method to define mock.On call
- ctx context.Context
- file *repository.FileInfo
func (*MockGithubRepository_Expecter) Stage ¶
func (_e *MockGithubRepository_Expecter) Stage(ctx interface{}, opts interface{}) *MockGithubRepository_Stage_Call
Stage is a helper method to define mock.On call
- ctx context.Context
- opts repository.StageOptions
func (*MockGithubRepository_Expecter) Test ¶
func (_e *MockGithubRepository_Expecter) Test(ctx interface{}) *MockGithubRepository_Test_Call
Test is a helper method to define mock.On call
- ctx context.Context
func (*MockGithubRepository_Expecter) Update ¶
func (_e *MockGithubRepository_Expecter) Update(ctx interface{}, path interface{}, ref interface{}, data interface{}, message interface{}) *MockGithubRepository_Update_Call
Update is a helper method to define mock.On call
- ctx context.Context
- path string
- ref string
- data []byte
- message string
func (*MockGithubRepository_Expecter) Validate ¶
func (_e *MockGithubRepository_Expecter) Validate() *MockGithubRepository_Validate_Call
Validate is a helper method to define mock.On call
func (*MockGithubRepository_Expecter) Write ¶
func (_e *MockGithubRepository_Expecter) Write(ctx interface{}, path interface{}, ref interface{}, data interface{}, message interface{}) *MockGithubRepository_Write_Call
Write is a helper method to define mock.On call
- ctx context.Context
- path string
- ref string
- data []byte
- message string
type MockGithubRepository_History_Call ¶
MockGithubRepository_History_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'History'
func (*MockGithubRepository_History_Call) Return ¶
func (_c *MockGithubRepository_History_Call) Return(_a0 []v0alpha1.HistoryItem, _a1 error) *MockGithubRepository_History_Call
func (*MockGithubRepository_History_Call) Run ¶
func (_c *MockGithubRepository_History_Call) Run(run func(ctx context.Context, path string, ref string)) *MockGithubRepository_History_Call
func (*MockGithubRepository_History_Call) RunAndReturn ¶
func (_c *MockGithubRepository_History_Call) RunAndReturn(run func(context.Context, string, string) ([]v0alpha1.HistoryItem, error)) *MockGithubRepository_History_Call
type MockGithubRepository_LatestRef_Call ¶
MockGithubRepository_LatestRef_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestRef'
func (*MockGithubRepository_LatestRef_Call) Return ¶
func (_c *MockGithubRepository_LatestRef_Call) Return(_a0 string, _a1 error) *MockGithubRepository_LatestRef_Call
func (*MockGithubRepository_LatestRef_Call) Run ¶
func (_c *MockGithubRepository_LatestRef_Call) Run(run func(ctx context.Context)) *MockGithubRepository_LatestRef_Call
func (*MockGithubRepository_LatestRef_Call) RunAndReturn ¶
func (_c *MockGithubRepository_LatestRef_Call) RunAndReturn(run func(context.Context) (string, error)) *MockGithubRepository_LatestRef_Call
type MockGithubRepository_ListRefs_Call ¶
MockGithubRepository_ListRefs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRefs'
func (*MockGithubRepository_ListRefs_Call) Return ¶
func (_c *MockGithubRepository_ListRefs_Call) Return(_a0 []v0alpha1.RefItem, _a1 error) *MockGithubRepository_ListRefs_Call
func (*MockGithubRepository_ListRefs_Call) Run ¶
func (_c *MockGithubRepository_ListRefs_Call) Run(run func(ctx context.Context)) *MockGithubRepository_ListRefs_Call
func (*MockGithubRepository_ListRefs_Call) RunAndReturn ¶
func (_c *MockGithubRepository_ListRefs_Call) RunAndReturn(run func(context.Context) ([]v0alpha1.RefItem, error)) *MockGithubRepository_ListRefs_Call
type MockGithubRepository_Move_Call ¶
MockGithubRepository_Move_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Move'
func (*MockGithubRepository_Move_Call) Return ¶
func (_c *MockGithubRepository_Move_Call) Return(_a0 error) *MockGithubRepository_Move_Call
func (*MockGithubRepository_Move_Call) Run ¶
func (_c *MockGithubRepository_Move_Call) Run(run func(ctx context.Context, oldPath string, newPath string, ref string, message string)) *MockGithubRepository_Move_Call
func (*MockGithubRepository_Move_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Move_Call) RunAndReturn(run func(context.Context, string, string, string, string) error) *MockGithubRepository_Move_Call
type MockGithubRepository_Owner_Call ¶
MockGithubRepository_Owner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Owner'
func (*MockGithubRepository_Owner_Call) Return ¶
func (_c *MockGithubRepository_Owner_Call) Return(_a0 string) *MockGithubRepository_Owner_Call
func (*MockGithubRepository_Owner_Call) Run ¶
func (_c *MockGithubRepository_Owner_Call) Run(run func()) *MockGithubRepository_Owner_Call
func (*MockGithubRepository_Owner_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Owner_Call) RunAndReturn(run func() string) *MockGithubRepository_Owner_Call
type MockGithubRepository_ReadTree_Call ¶
MockGithubRepository_ReadTree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadTree'
func (*MockGithubRepository_ReadTree_Call) Return ¶
func (_c *MockGithubRepository_ReadTree_Call) Return(_a0 []repository.FileTreeEntry, _a1 error) *MockGithubRepository_ReadTree_Call
func (*MockGithubRepository_ReadTree_Call) Run ¶
func (_c *MockGithubRepository_ReadTree_Call) Run(run func(ctx context.Context, ref string)) *MockGithubRepository_ReadTree_Call
func (*MockGithubRepository_ReadTree_Call) RunAndReturn ¶
func (_c *MockGithubRepository_ReadTree_Call) RunAndReturn(run func(context.Context, string) ([]repository.FileTreeEntry, error)) *MockGithubRepository_ReadTree_Call
type MockGithubRepository_Read_Call ¶
MockGithubRepository_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'
func (*MockGithubRepository_Read_Call) Return ¶
func (_c *MockGithubRepository_Read_Call) Return(_a0 *repository.FileInfo, _a1 error) *MockGithubRepository_Read_Call
func (*MockGithubRepository_Read_Call) Run ¶
func (_c *MockGithubRepository_Read_Call) Run(run func(ctx context.Context, path string, ref string)) *MockGithubRepository_Read_Call
func (*MockGithubRepository_Read_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Read_Call) RunAndReturn(run func(context.Context, string, string) (*repository.FileInfo, error)) *MockGithubRepository_Read_Call
type MockGithubRepository_RefURLs_Call ¶
MockGithubRepository_RefURLs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefURLs'
func (*MockGithubRepository_RefURLs_Call) Return ¶
func (_c *MockGithubRepository_RefURLs_Call) Return(_a0 *v0alpha1.RepositoryURLs, _a1 error) *MockGithubRepository_RefURLs_Call
func (*MockGithubRepository_RefURLs_Call) Run ¶
func (_c *MockGithubRepository_RefURLs_Call) Run(run func(ctx context.Context, ref string)) *MockGithubRepository_RefURLs_Call
func (*MockGithubRepository_RefURLs_Call) RunAndReturn ¶
func (_c *MockGithubRepository_RefURLs_Call) RunAndReturn(run func(context.Context, string) (*v0alpha1.RepositoryURLs, error)) *MockGithubRepository_RefURLs_Call
type MockGithubRepository_Repo_Call ¶
MockGithubRepository_Repo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repo'
func (*MockGithubRepository_Repo_Call) Return ¶
func (_c *MockGithubRepository_Repo_Call) Return(_a0 string) *MockGithubRepository_Repo_Call
func (*MockGithubRepository_Repo_Call) Run ¶
func (_c *MockGithubRepository_Repo_Call) Run(run func()) *MockGithubRepository_Repo_Call
func (*MockGithubRepository_Repo_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Repo_Call) RunAndReturn(run func() string) *MockGithubRepository_Repo_Call
type MockGithubRepository_ResourceURLs_Call ¶
MockGithubRepository_ResourceURLs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ResourceURLs'
func (*MockGithubRepository_ResourceURLs_Call) Return ¶
func (_c *MockGithubRepository_ResourceURLs_Call) Return(_a0 *v0alpha1.RepositoryURLs, _a1 error) *MockGithubRepository_ResourceURLs_Call
func (*MockGithubRepository_ResourceURLs_Call) Run ¶
func (_c *MockGithubRepository_ResourceURLs_Call) Run(run func(ctx context.Context, file *repository.FileInfo)) *MockGithubRepository_ResourceURLs_Call
func (*MockGithubRepository_ResourceURLs_Call) RunAndReturn ¶
func (_c *MockGithubRepository_ResourceURLs_Call) RunAndReturn(run func(context.Context, *repository.FileInfo) (*v0alpha1.RepositoryURLs, error)) *MockGithubRepository_ResourceURLs_Call
type MockGithubRepository_Stage_Call ¶
MockGithubRepository_Stage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stage'
func (*MockGithubRepository_Stage_Call) Return ¶
func (_c *MockGithubRepository_Stage_Call) Return(_a0 repository.StagedRepository, _a1 error) *MockGithubRepository_Stage_Call
func (*MockGithubRepository_Stage_Call) Run ¶
func (_c *MockGithubRepository_Stage_Call) Run(run func(ctx context.Context, opts repository.StageOptions)) *MockGithubRepository_Stage_Call
func (*MockGithubRepository_Stage_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Stage_Call) RunAndReturn(run func(context.Context, repository.StageOptions) (repository.StagedRepository, error)) *MockGithubRepository_Stage_Call
type MockGithubRepository_Test_Call ¶
MockGithubRepository_Test_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Test'
func (*MockGithubRepository_Test_Call) Return ¶
func (_c *MockGithubRepository_Test_Call) Return(_a0 *v0alpha1.TestResults, _a1 error) *MockGithubRepository_Test_Call
func (*MockGithubRepository_Test_Call) Run ¶
func (_c *MockGithubRepository_Test_Call) Run(run func(ctx context.Context)) *MockGithubRepository_Test_Call
func (*MockGithubRepository_Test_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Test_Call) RunAndReturn(run func(context.Context) (*v0alpha1.TestResults, error)) *MockGithubRepository_Test_Call
type MockGithubRepository_Update_Call ¶
MockGithubRepository_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
func (*MockGithubRepository_Update_Call) Return ¶
func (_c *MockGithubRepository_Update_Call) Return(_a0 error) *MockGithubRepository_Update_Call
func (*MockGithubRepository_Update_Call) Run ¶
func (_c *MockGithubRepository_Update_Call) Run(run func(ctx context.Context, path string, ref string, data []byte, message string)) *MockGithubRepository_Update_Call
func (*MockGithubRepository_Update_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Update_Call) RunAndReturn(run func(context.Context, string, string, []byte, string) error) *MockGithubRepository_Update_Call
type MockGithubRepository_Validate_Call ¶
MockGithubRepository_Validate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validate'
func (*MockGithubRepository_Validate_Call) Return ¶
func (_c *MockGithubRepository_Validate_Call) Return(_a0 field.ErrorList) *MockGithubRepository_Validate_Call
func (*MockGithubRepository_Validate_Call) Run ¶
func (_c *MockGithubRepository_Validate_Call) Run(run func()) *MockGithubRepository_Validate_Call
func (*MockGithubRepository_Validate_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Validate_Call) RunAndReturn(run func() field.ErrorList) *MockGithubRepository_Validate_Call
type MockGithubRepository_Write_Call ¶
MockGithubRepository_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'
func (*MockGithubRepository_Write_Call) Return ¶
func (_c *MockGithubRepository_Write_Call) Return(_a0 error) *MockGithubRepository_Write_Call
func (*MockGithubRepository_Write_Call) Run ¶
func (_c *MockGithubRepository_Write_Call) Run(run func(ctx context.Context, path string, ref string, data []byte, message string)) *MockGithubRepository_Write_Call
func (*MockGithubRepository_Write_Call) RunAndReturn ¶
func (_c *MockGithubRepository_Write_Call) RunAndReturn(run func(context.Context, string, string, []byte, string) error) *MockGithubRepository_Write_Call
type WebhookConfig ¶
type WebhookConfig struct {
// The ID of the webhook.
// Can be 0 on creation.
ID int64
// The events which this webhook shall contact the URL for.
Events []string
// Is the webhook enabled?
Active bool
// The URL GitHub should contact on events.
URL string
// The content type GitHub should send to the URL.
// If not specified, this is "form".
ContentType string
// The secret to use when sending events to the URL.
// If fetched from GitHub, this is empty as it contains no useful information.
Secret string
}
type WebhookRepository ¶
type WebhookRepository interface {
Webhook(ctx context.Context, req *http.Request) (*provisioning.WebhookResponse, error)
}
type WebhookURLBuilder ¶
type WebhookURLBuilder interface {
WebhookURL(ctx context.Context, r *provisioning.Repository) string
}