gitclone

package
v3.1.12+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedactCredsInText

func RedactCredsInText(text string, urlStr string) (redactedText string, _ error)

func RepoNameUsedInCacheDir

func RepoNameUsedInCacheDir(repoName, repoID string) string

func TestClone

func TestClone(logger hclog.Logger, url string, tempDirRoot string) error

TestClone tried to clone repo based on the url passed. If it fails returns an error. Does not do the full clone, exists after it confirms that remote is sending data.

Types

type AccessDetails

type AccessDetails struct {
	URL string
}

type CloneResults

type CloneResults struct {
	CacheDir string
	Checkout string
}

func CloneWithCache

func CloneWithCache(ctx context.Context, logger hclog.Logger, access AccessDetails, dirs Dirs, repoID string, name string) (_ CloneResults, rerr error)

CloneWithCache mirrors a provided repo into dirs.CacheRoot/name-repoID. And then checkout a copy into dirs.Checkout Automatically retries on errors.

type Dirs

type Dirs struct {
	CacheRoot string
}

Jump to

Keyboard shortcuts

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