Documentation ¶
Index ¶
- type Client
- type CommitOpt
- type GoGit
- type GogitClient
- func (g *GogitClient) Add(filename string) error
- func (g *GogitClient) Branch(name string) error
- func (g *GogitClient) Clone(ctx context.Context) error
- func (g *GogitClient) Commit(message string, opts ...CommitOpt) error
- func (g *GogitClient) CopyFile(curPath, dstPath string) error
- func (g *GogitClient) CreateFile(filename string, contents []byte) error
- func (g *GogitClient) DeleteFile(filename string) error
- func (g *GogitClient) Init() error
- func (g *GogitClient) ModifyFile(filename string, contents []byte) error
- func (g *GogitClient) MoveFile(curPath, dstPath string) error
- func (g *GogitClient) Pull(ctx context.Context, branch string) error
- func (g *GogitClient) Push(ctx context.Context) error
- func (g *GogitClient) ReadFile(filename string) (string, error)
- func (g *GogitClient) ReadFiles(foldername string) (map[string]string, error)
- func (g *GogitClient) Remove(filename string) error
- func (g *GogitClient) Status() error
- func (g *GogitClient) ValidateRemoteExists(ctx context.Context) error
- type Opt
- type RemoteBranchDoesNotExistError
- type RepositoryDoesNotExistError
- type RepositoryIsEmptyError
- type RepositoryUpToDateError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Add(filename string) error Remove(filename string) error Clone(ctx context.Context) error Commit(message string, opts ...CommitOpt) error Push(ctx context.Context) error Pull(ctx context.Context, branch string) error Status() error Init() error Branch(name string) error ValidateRemoteExists(ctx context.Context) error // filename for all the functions should be the full path from the repo base CreateFile(filename string, contents []byte) error CopyFile(curFile, dstFile string) error MoveFile(curFile, dstFile string) error DeleteFile(filename string) error ModifyFile(filename string, contents []byte) error ReadFile(filename string) (string, error) ReadFiles(foldername string) (map[string]string, error) }
type GoGit ¶
type GoGit interface { AddGlob(f string, w *gogit.Worktree) error Checkout(w *gogit.Worktree, opts *gogit.CheckoutOptions) error Clone(ctx context.Context, dir string, repoUrl string, auth transport.AuthMethod) (*gogit.Repository, error) CloneInMemory(ctx context.Context, repourl string, auth transport.AuthMethod) (*gogit.Repository, error) Commit(m string, sig *object.Signature, w *gogit.Worktree) (plumbing.Hash, error) CommitObject(r *gogit.Repository, h plumbing.Hash) (*object.Commit, error) Create(r *gogit.Repository, url string) (*gogit.Remote, error) CreateBranch(r *gogit.Repository, config *config.Branch) error Head(r *gogit.Repository) (*plumbing.Reference, error) NewRemote(url, remoteName string) *gogit.Remote Init(dir string) (*gogit.Repository, error) OpenRepo() (*gogit.Repository, error) OpenWorktree(r *gogit.Repository) (*gogit.Worktree, error) PushWithContext(ctx context.Context, r *gogit.Repository, auth transport.AuthMethod) error PullWithContext(ctx context.Context, w *gogit.Worktree, auth transport.AuthMethod, ref plumbing.ReferenceName) error ListRemotes(r *gogit.Repository, auth transport.AuthMethod) ([]*plumbing.Reference, error) ListWithContext(ctx context.Context, r *gogit.Remote, auth transport.AuthMethod) ([]*plumbing.Reference, error) Remove(f string, w *gogit.Worktree) (plumbing.Hash, error) SetRepositoryReference(r *gogit.Repository, p *plumbing.Reference) error WithRepositoryDirectory(dir string) }
type GogitClient ¶
type GogitClient struct { Auth transport.AuthMethod Client GoGit Retrier *retrier.Retrier RepoDirectory *string RepoUrl string InMemory bool }
func (*GogitClient) Add ¶
func (g *GogitClient) Add(filename string) error
func (*GogitClient) Branch ¶
func (g *GogitClient) Branch(name string) error
func (*GogitClient) CopyFile ¶
func (g *GogitClient) CopyFile(curPath, dstPath string) error
func (*GogitClient) CreateFile ¶
func (g *GogitClient) CreateFile(filename string, contents []byte) error
func (*GogitClient) DeleteFile ¶
func (g *GogitClient) DeleteFile(filename string) error
func (*GogitClient) Init ¶
func (g *GogitClient) Init() error
func (*GogitClient) ModifyFile ¶
func (g *GogitClient) ModifyFile(filename string, contents []byte) error
func (*GogitClient) MoveFile ¶
func (g *GogitClient) MoveFile(curPath, dstPath string) error
func (*GogitClient) ReadFiles ¶
func (g *GogitClient) ReadFiles(foldername string) (map[string]string, error)
func (*GogitClient) Remove ¶
func (g *GogitClient) Remove(filename string) error
func (*GogitClient) Status ¶
func (g *GogitClient) Status() error
func (*GogitClient) ValidateRemoteExists ¶
func (g *GogitClient) ValidateRemoteExists(ctx context.Context) error
type Opt ¶
type Opt func(*GogitClient)
func WithAuth ¶
func WithAuth(auth transport.AuthMethod) Opt
func WithInMemoryFilesystem ¶
func WithInMemoryFilesystem() Opt
func WithRepositoryDirectory ¶
func WithRepositoryUrl ¶
type RemoteBranchDoesNotExistError ¶
func (*RemoteBranchDoesNotExistError) Error ¶
func (e *RemoteBranchDoesNotExistError) Error() string
type RepositoryDoesNotExistError ¶
type RepositoryDoesNotExistError struct { Err error // contains filtered or unexported fields }
func (*RepositoryDoesNotExistError) Error ¶
func (e *RepositoryDoesNotExistError) Error() string
type RepositoryIsEmptyError ¶
type RepositoryIsEmptyError struct {
Repository string
}
func (*RepositoryIsEmptyError) Error ¶
func (e *RepositoryIsEmptyError) Error() string
type RepositoryUpToDateError ¶
type RepositoryUpToDateError struct{}
func (*RepositoryUpToDateError) Error ¶
func (e *RepositoryUpToDateError) Error() string
Click to show internal directories.
Click to hide internal directories.