git

package
v1.1.1-0...-18dfa52 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRepositoryURL = errors.New("repository URL must start with https://")
	ErrCloneFailed          = errors.New("failed to clone repository")
	ErrCheckoutFailed       = errors.New("failed to checkout")
	ErrFetchingFailed       = errors.New("failed to fetch")
)

Functions

This section is empty.

Types

type GitRepo

type GitRepo struct {
	// contains filtered or unexported fields
}

func NewGitRepo

func NewGitRepo(url string) GitRepo

NewGitRepo returns new instance of Git repository linked to the given URL.

func (GitRepo) Clone

func (g GitRepo) Clone(dstPath string) error

Clone clones a git project with the given URL and version into a specific directory.

func (GitRepo) Url

func (p GitRepo) Url() string

func (GitRepo) WithCommitHash

func (r GitRepo) WithCommitHash(commitHash string) GitRepo

WithCommitHash sets the repository checkout commit hash which is used when repository is cloned.

func (GitRepo) WithRef

func (r GitRepo) WithRef(branchOrTag string) GitRepo

WithRef sets the repository reference to the given branch or tag. Reference is used when cloning a repository.

Jump to

Keyboard shortcuts

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