Documentation ¶
Overview ¶
Git Repository Adapter
Index ¶
- Constants
- func InitEmptyRepositoryWithWorktree(t *testing.T, path string) *gogit.Repository
- func OpenGitRepositoryFromArchive(t *testing.T, tarfile, tempdir string) *gogit.Repository
- func OpenGitRepositoryFromArchiveWithWorktree(t *testing.T, tarfile, path string) *gogit.Repository
- func ServeGitRepository(t *testing.T, tarfile, tempdir string) (*gogit.Repository, string)
- func TestDataAbs(t *testing.T, rel string) string
- type GitHash
- type GitRepository
- type GitRepositoryOptions
- type GitServer
- type GitServerOption
- type PacketLineWriter
- type RefUpdate
Constants ¶
View Source
const (
Main plumbing.ReferenceName = "refs/heads/main"
)
Variables ¶
This section is empty.
Functions ¶
func InitEmptyRepositoryWithWorktree ¶
func InitEmptyRepositoryWithWorktree(t *testing.T, path string) *gogit.Repository
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 ServeGitRepository ¶
Types ¶
type GitRepository ¶
type GitRepository interface { repository.Repository GetPackage(ref, path string) (repository.PackageRevision, kptfilev1.GitLock, error) }
func OpenRepository ¶
func OpenRepository(ctx context.Context, name, namespace string, spec *configapi.GitRepository, root string, opts GitRepositoryOptions) (GitRepository, error)
type GitRepositoryOptions ¶
type GitRepositoryOptions struct { CredentialResolver repository.CredentialResolver UserInfoProvider repository.UserInfoProvider }
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(repo *gogit.Repository, opts ...GitServerOption) (*GitServer, error)
NewGitServer constructs a GitServer backed by the specified repo.
type GitServerOption ¶
type GitServerOption interface {
// contains filtered or unexported methods
}
func WithBasicAuth ¶
func WithBasicAuth(username, password string) GitServerOption
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
NewPackageLineWriter 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
Click to show internal directories.
Click to hide internal directories.