gogit

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoGit

type GoGit struct {
	Opts    Options
	Client  GoGitClient
	Retrier *retrier.Retrier
}

func New

func New(opts Options) *GoGit

func (*GoGit) Add

func (g *GoGit) Add(filename string) error

func (*GoGit) Branch

func (g *GoGit) Branch(name string) error

func (*GoGit) Clone

func (g *GoGit) Clone(ctx context.Context, repourl string) error

func (*GoGit) Commit

func (g *GoGit) Commit(message string) error

func (*GoGit) Init

func (g *GoGit) Init(url string) error

func (*GoGit) Pull

func (g *GoGit) Pull(ctx context.Context, branch string) error

func (*GoGit) Push

func (g *GoGit) Push(ctx context.Context) error

func (*GoGit) Remove

func (g *GoGit) Remove(filename string) error

func (*GoGit) SetTokenAuth

func (g *GoGit) SetTokenAuth(token string, username string)

type GoGitClient

type GoGitClient 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)
	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)
	Init(dir string) (*gogit.Repository, error)
	OpenDir(dir string) (*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)
	Remove(f string, w *gogit.Worktree) (plumbing.Hash, error)
	SetRepositoryReference(r *gogit.Repository, p *plumbing.Reference) error
}

type Options

type Options struct {
	RepositoryDirectory string
	Auth                transport.AuthMethod
	GoGitClient         GoGitClient
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL