Documentation
¶
Index ¶
- func CreateEmptyCommit(repo *gogit.Repository) error
- func ExtractTar(t *testing.T, tarfile string, dir string)
- func OpenGitRepositoryFromArchive(t *testing.T, tarfile, tempdir string) *gogit.Repository
- func OpenGitRepositoryFromArchiveWithWorktree(t *testing.T, tarfile, path string) *gogit.Repository
- func ServeExistingRepository(t *testing.T, repo *gogit.Repository) string
- func ServeGitRepository(t *testing.T, tarfile, tempdir string) (*gogit.Repository, string)
- type DynamicRepos
- type GitHash
- type GitRepoOption
- type GitServer
- type GitServerOption
- type PacketLineWriter
- type RefUpdate
- type Repo
- type Repos
- type StaticRepos
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEmptyCommit ¶
func CreateEmptyCommit(repo *gogit.Repository) error
func OpenGitRepositoryFromArchive ¶
func OpenGitRepositoryFromArchive(t *testing.T, tarfile, tempdir string) *gogit.Repository
func OpenGitRepositoryFromArchiveWithWorktree ¶
func OpenGitRepositoryFromArchiveWithWorktree(t *testing.T, tarfile, path string) *gogit.Repository
func ServeExistingRepository ¶
func ServeExistingRepository(t *testing.T, repo *gogit.Repository) string
func ServeGitRepository ¶
Types ¶
type DynamicRepos ¶
type DynamicRepos struct {
// contains filtered or unexported fields
}
func NewDynamicRepos ¶
func NewDynamicRepos(baseDir string, gitRepoOptions []GitRepoOption) *DynamicRepos
type GitRepoOption ¶
type GitRepoOption interface {
// contains filtered or unexported methods
}
GitRepoOption is implemented by configuration settings for git repository.
func WithBasicAuth ¶
func WithBasicAuth(username, password string) GitRepoOption
type GitServer ¶
type GitServer struct {
// contains filtered or unexported fields
}
GitServer is a mock git server implementing "just enough" of the git protocol
func NewGitServer ¶
func NewGitServer(repos Repos, opts ...GitServerOption) (*GitServer, error)
NewGitServer constructs a GitServer backed by the specified repo.
type GitServerOption ¶
type GitServerOption interface {
// contains filtered or unexported methods
}
type PacketLineWriter ¶
type PacketLineWriter struct {
// contains filtered or unexported fields
}
PacketLineWriter implements the git protocol line framing, with deferred error handling.
func NewPacketLineWriter ¶
func NewPacketLineWriter(w io.Writer) *PacketLineWriter
NewPacketLineWriter constructs a PacketLineWriter
func (*PacketLineWriter) Flush ¶
func (w *PacketLineWriter) Flush() error
Flush writes any buffered data, and returns an error if one has accumulated.
func (*PacketLineWriter) WriteLine ¶
func (w *PacketLineWriter) WriteLine(s string)
WriteLine frames and writes a line, accumulating errors until Flush is called.
func (*PacketLineWriter) WriteZeroPacketLine ¶
func (w *PacketLineWriter) WriteZeroPacketLine()
WriteZeroPacketLine writes a special "0000" line - often used to indicate the end of a block in the git protocol
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo manages a single git repository
func NewRepo ¶
func NewRepo(gogit *gogit.Repository, options ...GitRepoOption) (*Repo, error)
NewRepo constructs an instance of Repo
type StaticRepos ¶
type StaticRepos struct {
// contains filtered or unexported fields
}
StaticRepos holds multiple registered git repositories
func NewStaticRepos ¶
func NewStaticRepos() *StaticRepos
NewStaticRepos constructs an instance of StaticRepos