Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
func Clone(repoURL string, tagName string, localPath string, writer io.Writer) (*git.Repository, error)
Clone will clone from `repoURL` to `localPath` via git by tag name. Deprecated: This function will be removed in a future version. Use CloneWithOpts instead.
func CloneWithOpts ¶ added in v0.6.0
func CloneWithOpts(opts ...CloneOption) (*git.Repository, error)
CloneWithOpts will clone from `repoURL` to `localPath` via git by using CloneOptions
Types ¶
type CloneOption ¶ added in v0.6.0
type CloneOption func(*CloneOptions)
CloneOption is a function that modifies CloneOptions
func WithBranch ¶ added in v0.6.0
func WithBranch(branch string) CloneOption
WithBranch sets the branch for CloneOptions
func WithCommit ¶ added in v0.6.0
func WithCommit(commit string) CloneOption
WithCommit sets the commit for CloneOptions
func WithLocalPath ¶ added in v0.6.0
func WithLocalPath(localPath string) CloneOption
WithLocalPath sets the local path for CloneOptions
func WithRepoURL ¶ added in v0.6.0
func WithRepoURL(repoURL string) CloneOption
WithRepoURL sets the repo URL for CloneOptions
func WithTag ¶ added in v0.6.0
func WithTag(tag string) CloneOption
WithTag sets the tag for CloneOptions
func WithWriter ¶ added in v0.6.0
func WithWriter(writer io.Writer) CloneOption
WithWriter sets the writer for CloneOptions
type CloneOptions ¶ added in v0.6.0
type CloneOptions struct { RepoURL string Commit string Tag string Branch string LocalPath string Writer io.Writer }
CloneOptions is a struct for specifying options for cloning a git repository
func NewCloneOptions ¶ added in v0.8.0
func NewCloneOptions(repoUrl, commit, tag, branch, localpath string, Writer io.Writer) *CloneOptions
func (*CloneOptions) Clone ¶ added in v0.6.0
func (cloneOpts *CloneOptions) Clone() (*git.Repository, error)
Clone clones a git repository
func (*CloneOptions) Validate ¶ added in v0.6.0
func (cloneOpts *CloneOptions) Validate() error
Validate checks if the CloneOptions are valid