Documentation
¶
Index ¶
- type GitOptions
- type GitProvider
- type GitProviderImpl
- func (g *GitProviderImpl) Checkout(ctx context.Context, repoDir string, commitHash string) error
- func (g *GitProviderImpl) Clone(ctx context.Context, repoURL, destDir string, options ...GitOptions) error
- func (g *GitProviderImpl) GetCommitHashBeforeDate(ctx context.Context, repoDir string, dateTime time.Time) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitOptions ¶
type GitOptions func() []string
func WithGitBranch ¶
func WithGitBranch(branch string) GitOptions
WithGitBranch returns a GitOptions that specifies the branch to clone.
type GitProvider ¶
type GitProvider interface {
// Clone clones a git repository to the specified destination
Clone(ctx context.Context, repoURL string, destDir string, options ...GitOptions) error
// Checkout checks out a specific commit in the repository at the specified directory.
Checkout(ctx context.Context, repoDir string, commitHash string) error
// GetCommitHashBeforeDate returns the commit hash at or before the specified date in the repository.
GetCommitHashBeforeDate(ctx context.Context, repoDir string, dateTime time.Time) (string, error)
}
type GitProviderImpl ¶
type GitProviderImpl struct {
// contains filtered or unexported fields
}
func NewGitProviderImpl ¶
func NewGitProviderImpl(eventListener opctx.EventListener, cmdFactory opctx.CmdFactory) (*GitProviderImpl, error)
func (*GitProviderImpl) Clone ¶
func (g *GitProviderImpl) Clone(ctx context.Context, repoURL, destDir string, options ...GitOptions) error
func (*GitProviderImpl) GetCommitHashBeforeDate ¶
Click to show internal directories.
Click to hide internal directories.