Documentation
¶
Index ¶
- func SSHKeyAuth(privateKey []byte, user string, ignoreHostKeys bool) (transport.AuthMethod, error)
- type MockRepository
- func (_m *MockRepository) Add(paths ...string) error
- func (_m *MockRepository) Commit(message string) (plumbing.Hash, error)
- func (_m *MockRepository) Config() (*config.Config, error)
- func (_m *MockRepository) CreateRemote(name string, url string) (*v5.Remote, error)
- func (_m *MockRepository) EXPECT() *MockRepository_Expecter
- func (_m *MockRepository) Init(path string, branch string) (*v5.Repository, error)
- func (_m *MockRepository) InitAndCommit(dir string, url string, cfg *config.Config) error
- func (_m *MockRepository) PlainCloneContext(ctx context.Context, path string, o *v5.CloneOptions) (*v5.Repository, error)
- func (_m *MockRepository) Push(o *v5.PushOptions) error
- func (_m *MockRepository) Repo() *v5.Repository
- type MockRepository_Add_Call
- type MockRepository_Commit_Call
- func (_c *MockRepository_Commit_Call) Return(_a0 plumbing.Hash, _a1 error) *MockRepository_Commit_Call
- func (_c *MockRepository_Commit_Call) Run(run func(message string)) *MockRepository_Commit_Call
- func (_c *MockRepository_Commit_Call) RunAndReturn(run func(string) (plumbing.Hash, error)) *MockRepository_Commit_Call
- type MockRepository_Config_Call
- func (_c *MockRepository_Config_Call) Return(_a0 *config.Config, _a1 error) *MockRepository_Config_Call
- func (_c *MockRepository_Config_Call) Run(run func()) *MockRepository_Config_Call
- func (_c *MockRepository_Config_Call) RunAndReturn(run func() (*config.Config, error)) *MockRepository_Config_Call
- type MockRepository_CreateRemote_Call
- func (_c *MockRepository_CreateRemote_Call) Return(_a0 *v5.Remote, _a1 error) *MockRepository_CreateRemote_Call
- func (_c *MockRepository_CreateRemote_Call) Run(run func(name string, url string)) *MockRepository_CreateRemote_Call
- func (_c *MockRepository_CreateRemote_Call) RunAndReturn(run func(string, string) (*v5.Remote, error)) *MockRepository_CreateRemote_Call
- type MockRepository_Expecter
- func (_e *MockRepository_Expecter) Add(paths ...interface{}) *MockRepository_Add_Call
- func (_e *MockRepository_Expecter) Commit(message interface{}) *MockRepository_Commit_Call
- func (_e *MockRepository_Expecter) Config() *MockRepository_Config_Call
- func (_e *MockRepository_Expecter) CreateRemote(name interface{}, url interface{}) *MockRepository_CreateRemote_Call
- func (_e *MockRepository_Expecter) Init(path interface{}, branch interface{}) *MockRepository_Init_Call
- func (_e *MockRepository_Expecter) InitAndCommit(dir interface{}, url interface{}, cfg interface{}) *MockRepository_InitAndCommit_Call
- func (_e *MockRepository_Expecter) PlainCloneContext(ctx interface{}, path interface{}, o interface{}) *MockRepository_PlainCloneContext_Call
- func (_e *MockRepository_Expecter) Push(o interface{}) *MockRepository_Push_Call
- func (_e *MockRepository_Expecter) Repo() *MockRepository_Repo_Call
- type MockRepository_InitAndCommit_Call
- func (_c *MockRepository_InitAndCommit_Call) Return(_a0 error) *MockRepository_InitAndCommit_Call
- func (_c *MockRepository_InitAndCommit_Call) Run(run func(dir string, url string, cfg *config.Config)) *MockRepository_InitAndCommit_Call
- func (_c *MockRepository_InitAndCommit_Call) RunAndReturn(run func(string, string, *config.Config) error) *MockRepository_InitAndCommit_Call
- type MockRepository_Init_Call
- func (_c *MockRepository_Init_Call) Return(_a0 *v5.Repository, _a1 error) *MockRepository_Init_Call
- func (_c *MockRepository_Init_Call) Run(run func(path string, branch string)) *MockRepository_Init_Call
- func (_c *MockRepository_Init_Call) RunAndReturn(run func(string, string) (*v5.Repository, error)) *MockRepository_Init_Call
- type MockRepository_PlainCloneContext_Call
- func (_c *MockRepository_PlainCloneContext_Call) Return(_a0 *v5.Repository, _a1 error) *MockRepository_PlainCloneContext_Call
- func (_c *MockRepository_PlainCloneContext_Call) Run(run func(ctx context.Context, path string, o *v5.CloneOptions)) *MockRepository_PlainCloneContext_Call
- func (_c *MockRepository_PlainCloneContext_Call) RunAndReturn(run func(context.Context, string, *v5.CloneOptions) (*v5.Repository, error)) *MockRepository_PlainCloneContext_Call
- type MockRepository_Push_Call
- type MockRepository_Repo_Call
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SSHKeyAuth ¶ added in v0.7.1
Types ¶
type MockRepository ¶
MockRepository is an autogenerated mock type for the Repository type
func NewMockRepository ¶
func NewMockRepository(t interface { mock.TestingT Cleanup(func()) }) *MockRepository
NewMockRepository creates a new instance of MockRepository. 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 (*MockRepository) Add ¶
func (_m *MockRepository) Add(paths ...string) error
Add provides a mock function with given fields: paths
func (*MockRepository) Commit ¶
func (_m *MockRepository) Commit(message string) (plumbing.Hash, error)
Commit provides a mock function with given fields: message
func (*MockRepository) Config ¶ added in v0.5.2
func (_m *MockRepository) Config() (*config.Config, error)
Config provides a mock function with no fields
func (*MockRepository) CreateRemote ¶
CreateRemote provides a mock function with given fields: name, url
func (*MockRepository) EXPECT ¶
func (_m *MockRepository) EXPECT() *MockRepository_Expecter
func (*MockRepository) Init ¶
func (_m *MockRepository) Init(path string, branch string) (*v5.Repository, error)
Init provides a mock function with given fields: path, branch
func (*MockRepository) InitAndCommit ¶
InitAndCommit provides a mock function with given fields: dir, url, cfg
func (*MockRepository) PlainCloneContext ¶
func (_m *MockRepository) PlainCloneContext(ctx context.Context, path string, o *v5.CloneOptions) (*v5.Repository, error)
PlainCloneContext provides a mock function with given fields: ctx, path, o
func (*MockRepository) Push ¶
func (_m *MockRepository) Push(o *v5.PushOptions) error
Push provides a mock function with given fields: o
func (*MockRepository) Repo ¶
func (_m *MockRepository) Repo() *v5.Repository
Repo provides a mock function with no fields
type MockRepository_Add_Call ¶
MockRepository_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add'
func (*MockRepository_Add_Call) Return ¶
func (_c *MockRepository_Add_Call) Return(_a0 error) *MockRepository_Add_Call
func (*MockRepository_Add_Call) Run ¶
func (_c *MockRepository_Add_Call) Run(run func(paths ...string)) *MockRepository_Add_Call
func (*MockRepository_Add_Call) RunAndReturn ¶
func (_c *MockRepository_Add_Call) RunAndReturn(run func(...string) error) *MockRepository_Add_Call
type MockRepository_Commit_Call ¶
MockRepository_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit'
func (*MockRepository_Commit_Call) Return ¶
func (_c *MockRepository_Commit_Call) Return(_a0 plumbing.Hash, _a1 error) *MockRepository_Commit_Call
func (*MockRepository_Commit_Call) Run ¶
func (_c *MockRepository_Commit_Call) Run(run func(message string)) *MockRepository_Commit_Call
func (*MockRepository_Commit_Call) RunAndReturn ¶
func (_c *MockRepository_Commit_Call) RunAndReturn(run func(string) (plumbing.Hash, error)) *MockRepository_Commit_Call
type MockRepository_Config_Call ¶ added in v0.5.2
MockRepository_Config_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Config'
func (*MockRepository_Config_Call) Return ¶ added in v0.5.2
func (_c *MockRepository_Config_Call) Return(_a0 *config.Config, _a1 error) *MockRepository_Config_Call
func (*MockRepository_Config_Call) Run ¶ added in v0.5.2
func (_c *MockRepository_Config_Call) Run(run func()) *MockRepository_Config_Call
func (*MockRepository_Config_Call) RunAndReturn ¶ added in v0.5.2
func (_c *MockRepository_Config_Call) RunAndReturn(run func() (*config.Config, error)) *MockRepository_Config_Call
type MockRepository_CreateRemote_Call ¶
MockRepository_CreateRemote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRemote'
func (*MockRepository_CreateRemote_Call) Return ¶
func (_c *MockRepository_CreateRemote_Call) Return(_a0 *v5.Remote, _a1 error) *MockRepository_CreateRemote_Call
func (*MockRepository_CreateRemote_Call) Run ¶
func (_c *MockRepository_CreateRemote_Call) Run(run func(name string, url string)) *MockRepository_CreateRemote_Call
func (*MockRepository_CreateRemote_Call) RunAndReturn ¶
func (_c *MockRepository_CreateRemote_Call) RunAndReturn(run func(string, string) (*v5.Remote, error)) *MockRepository_CreateRemote_Call
type MockRepository_Expecter ¶
type MockRepository_Expecter struct {
// contains filtered or unexported fields
}
func (*MockRepository_Expecter) Add ¶
func (_e *MockRepository_Expecter) Add(paths ...interface{}) *MockRepository_Add_Call
Add is a helper method to define mock.On call
- paths ...string
func (*MockRepository_Expecter) Commit ¶
func (_e *MockRepository_Expecter) Commit(message interface{}) *MockRepository_Commit_Call
Commit is a helper method to define mock.On call
- message string
func (*MockRepository_Expecter) Config ¶ added in v0.5.2
func (_e *MockRepository_Expecter) Config() *MockRepository_Config_Call
Config is a helper method to define mock.On call
func (*MockRepository_Expecter) CreateRemote ¶
func (_e *MockRepository_Expecter) CreateRemote(name interface{}, url interface{}) *MockRepository_CreateRemote_Call
CreateRemote is a helper method to define mock.On call
- name string
- url string
func (*MockRepository_Expecter) Init ¶
func (_e *MockRepository_Expecter) Init(path interface{}, branch interface{}) *MockRepository_Init_Call
Init is a helper method to define mock.On call
- path string
- branch string
func (*MockRepository_Expecter) InitAndCommit ¶
func (_e *MockRepository_Expecter) InitAndCommit(dir interface{}, url interface{}, cfg interface{}) *MockRepository_InitAndCommit_Call
InitAndCommit is a helper method to define mock.On call
- dir string
- url string
- cfg *config.Config
func (*MockRepository_Expecter) PlainCloneContext ¶
func (_e *MockRepository_Expecter) PlainCloneContext(ctx interface{}, path interface{}, o interface{}) *MockRepository_PlainCloneContext_Call
PlainCloneContext is a helper method to define mock.On call
- ctx context.Context
- path string
- o *v5.CloneOptions
func (*MockRepository_Expecter) Push ¶
func (_e *MockRepository_Expecter) Push(o interface{}) *MockRepository_Push_Call
Push is a helper method to define mock.On call
- o *v5.PushOptions
func (*MockRepository_Expecter) Repo ¶
func (_e *MockRepository_Expecter) Repo() *MockRepository_Repo_Call
Repo is a helper method to define mock.On call
type MockRepository_InitAndCommit_Call ¶
MockRepository_InitAndCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InitAndCommit'
func (*MockRepository_InitAndCommit_Call) Return ¶
func (_c *MockRepository_InitAndCommit_Call) Return(_a0 error) *MockRepository_InitAndCommit_Call
func (*MockRepository_InitAndCommit_Call) Run ¶
func (_c *MockRepository_InitAndCommit_Call) Run(run func(dir string, url string, cfg *config.Config)) *MockRepository_InitAndCommit_Call
func (*MockRepository_InitAndCommit_Call) RunAndReturn ¶
func (_c *MockRepository_InitAndCommit_Call) RunAndReturn(run func(string, string, *config.Config) error) *MockRepository_InitAndCommit_Call
type MockRepository_Init_Call ¶
MockRepository_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'
func (*MockRepository_Init_Call) Return ¶
func (_c *MockRepository_Init_Call) Return(_a0 *v5.Repository, _a1 error) *MockRepository_Init_Call
func (*MockRepository_Init_Call) Run ¶
func (_c *MockRepository_Init_Call) Run(run func(path string, branch string)) *MockRepository_Init_Call
func (*MockRepository_Init_Call) RunAndReturn ¶
func (_c *MockRepository_Init_Call) RunAndReturn(run func(string, string) (*v5.Repository, error)) *MockRepository_Init_Call
type MockRepository_PlainCloneContext_Call ¶
MockRepository_PlainCloneContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PlainCloneContext'
func (*MockRepository_PlainCloneContext_Call) Return ¶
func (_c *MockRepository_PlainCloneContext_Call) Return(_a0 *v5.Repository, _a1 error) *MockRepository_PlainCloneContext_Call
func (*MockRepository_PlainCloneContext_Call) Run ¶
func (_c *MockRepository_PlainCloneContext_Call) Run(run func(ctx context.Context, path string, o *v5.CloneOptions)) *MockRepository_PlainCloneContext_Call
func (*MockRepository_PlainCloneContext_Call) RunAndReturn ¶
func (_c *MockRepository_PlainCloneContext_Call) RunAndReturn(run func(context.Context, string, *v5.CloneOptions) (*v5.Repository, error)) *MockRepository_PlainCloneContext_Call
type MockRepository_Push_Call ¶
MockRepository_Push_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Push'
func (*MockRepository_Push_Call) Return ¶
func (_c *MockRepository_Push_Call) Return(_a0 error) *MockRepository_Push_Call
func (*MockRepository_Push_Call) Run ¶
func (_c *MockRepository_Push_Call) Run(run func(o *v5.PushOptions)) *MockRepository_Push_Call
func (*MockRepository_Push_Call) RunAndReturn ¶
func (_c *MockRepository_Push_Call) RunAndReturn(run func(*v5.PushOptions) error) *MockRepository_Push_Call
type MockRepository_Repo_Call ¶
MockRepository_Repo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Repo'
func (*MockRepository_Repo_Call) Return ¶
func (_c *MockRepository_Repo_Call) Return(_a0 *v5.Repository) *MockRepository_Repo_Call
func (*MockRepository_Repo_Call) Run ¶
func (_c *MockRepository_Repo_Call) Run(run func()) *MockRepository_Repo_Call
func (*MockRepository_Repo_Call) RunAndReturn ¶
func (_c *MockRepository_Repo_Call) RunAndReturn(run func() *v5.Repository) *MockRepository_Repo_Call
type Repository ¶
type Repository interface { // Repo returns the git repository Repo() *git.Repository // Init initializes a new git repository in the specified path with the Init(path string, branch string) (*git.Repository, error) // PlainCloneContext clones a git repository to the specified path PlainCloneContext(ctx context.Context, path string, o *git.CloneOptions) (*git.Repository, error) // CreateRemote creates a new remote with the specified name and url CreateRemote(name string, url string) (*git.Remote, error) // Add adds the specified files to the repository Add(paths ...string) error // Commit commits the changes to the repository Commit(message string) (plumbing.Hash, error) // Push pushes the changes to the remote Push(o *git.PushOptions) error // InitAndCommit initializes a git repository, adds all files in the directory, InitAndCommit(dir string, url string, cfg *config.Config) error // Config returns the repository configuration Config() (*config.Config, error) }
Repository is an interface for interacting with git repositories
func NewRepository ¶
func NewRepository(repo *git.Repository) Repository
NewGitRepository returns a new gitRepository