Documentation ¶
Index ¶
- Variables
- func GetClonedPath(vcsurl, destDirName string, overwrite bool) (string, error)
- func IsRemotePath(input string) bool
- func Limit(s storage.Storer, n int64) storage.Storer
- func PushVCSRepo(remotePath, folderName string) error
- func SetMaxRepoCloneSize(size int64)
- type FailedVCSPush
- type GitVCSRepo
- type Limited
- type NoCompatibleVCSFound
- type VCS
- type VCSCloneOptions
Constants ¶
This section is empty.
Variables ¶
var ErrLimitExceeded = errors.New("repo size limit exceeded")
ErrLimitExceeded is the error returned when the storage limit has been exceeded (usually during git clone)
Functions ¶
func GetClonedPath ¶
GetClonedPath takes a vcsurl and a folder name, performs a clone with the appropriate VCS, and then returns the file system and remote paths. If the VCS is not supported, the returned path will be an empty string.
func IsRemotePath ¶
IsRemotePath returns if the provided input is a remote path or not
func PushVCSRepo ¶
PushVCSRepo commits and pushes the changes in the provide vcs remote path
func SetMaxRepoCloneSize ¶ added in v0.3.12
func SetMaxRepoCloneSize(size int64)
SetMaxRepoCloneSize sets the maximum size (in bytes) for cloning a repo
Types ¶
type FailedVCSPush ¶
FailedVCSPush is the error when push is failed
func (*FailedVCSPush) Error ¶
func (e *FailedVCSPush) Error() string
Error returns the error message for failed push
type GitVCSRepo ¶
type GitVCSRepo struct { InputURL string URL string Branch string Tag string CommitHash string PathWithinRepo string GitRepository *git.Repository GitRepoPath string }
GitVCSRepo stores git repo config
func (*GitVCSRepo) Clone ¶
func (gvcsrepo *GitVCSRepo) Clone(cloneOptions VCSCloneOptions) (string, error)
Clone clones a git repository with the given commit depth and path where it is to be cloned and returns the final path inside the repo
type Limited ¶ added in v0.3.12
Limited wraps git.Storer to limit the number of bytes that can be stored.
func (*Limited) Module ¶ added in v0.3.12
Module is a Storer interface method that is used to get the working tree for a repo sub-module
func (*Limited) SetEncodedObject ¶ added in v0.3.12
SetEncodedObject is a Storer interface method that is used to store an object
type NoCompatibleVCSFound ¶
type NoCompatibleVCSFound struct {
URLInput string
}
NoCompatibleVCSFound is the error when no VCS is found suitable for the given remote input path
func (*NoCompatibleVCSFound) Error ¶
func (e *NoCompatibleVCSFound) Error() string
Error returns the error message for no valid vcs is found
type VCS ¶
type VCS interface {
Clone(VCSCloneOptions) (string, error)
}
VCS defines interface for version control system
func GetVCSRepo ¶
GetVCSRepo extracts information from the given vcsurl and returns a relevant vcs repo struct