Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneOrPullURL ¶
func CloneOrPullURL(ctx context.Context, url, destPath string, opts *CloneOptions) error
CloneOrPullURL clones a git repository if it doesn't exist at destPath, or pulls if it does.
func CloneURL ¶
func CloneURL(ctx context.Context, url, destPath string, opts *CloneOptions) error
CloneURL clones a git repository from url to destPath.
Types ¶
type CloneOptions ¶
type CloneOptions struct {
// Branch to checkout (default: default branch)
Branch string
// Depth for shallow clone (0 = full clone)
Depth int
}
CloneOptions configures clone behavior.
type Repository ¶
type Repository struct {
// Owner is the repository owner (e.g., "aquaproj" for github.com/aquaproj/aqua-registry)
Owner string
// Name is the repository name (e.g., "aqua-registry")
Name string
// Host is the git host (default: "github.com")
Host string
}
Repository represents a git repository with its metadata.
func NewRepository ¶
func NewRepository(owner, name string) *Repository
NewRepository creates a new Repository with the given owner and name. Host defaults to "github.com".
func (*Repository) Clone ¶
func (r *Repository) Clone(ctx context.Context, destPath string, opts *CloneOptions) error
Clone clones the repository to destPath.
func (*Repository) CloneOrPull ¶
func (r *Repository) CloneOrPull(ctx context.Context, destPath string, opts *CloneOptions) error
CloneOrPull clones the repository if it doesn't exist at destPath, or pulls if it does.
func (*Repository) Pull ¶
func (r *Repository) Pull(ctx context.Context, repoPath string) error
Pull pulls latest changes for the repository at repoPath.
func (*Repository) URL ¶
func (r *Repository) URL() string
URL returns the HTTPS clone URL for the repository.
Click to show internal directories.
Click to hide internal directories.