git

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheDir = os.Getenv("HOME") + "/.anyvendor/git"

set to override cache dir

View Source
var ProgressOut = os.Stdout

set to override progress logging

Functions

This section is empty.

Types

type GitRepository

type GitRepository struct {
	// The repo URL
	URL string
	// provide one of SHA or Tag
	SHA string
	Tag string

	// HTTP Auth User (for private repository)
	AuthUser string
	// HTTP Auth Token (for private repository)
	AuthToken string

	// match files with these patterns in the repo
	MatchPatterns []string
	// skip these dirs when vendoring files
	SkipDirs []string
}

vendor files from a git repository

func (*GitRepository) Vendor

func (r *GitRepository) Vendor(cache *GitVendorCache, vendorDir string) error

type GitVendorCache

type GitVendorCache struct {
	Dir string
}

GitVendorCache maintains a local cache of vendored git repos

func DefaultCache

func DefaultCache() *GitVendorCache

func (*GitVendorCache) EnsureCheckedOut

func (c *GitVendorCache) EnsureCheckedOut(
	url, sha, tag, authUser, authToken string,
) error

func (*GitVendorCache) GetRepoDir

func (c *GitVendorCache) GetRepoDir(url string) (string, string)

func (*GitVendorCache) Init

func (c *GitVendorCache) Init() error

type VendorOptions

type VendorOptions struct {
	GitRepositories []GitRepository
}

vendor files from git repositories

func (VendorOptions) Vendor

func (r VendorOptions) Vendor(cache *GitVendorCache, vendorDir string) error

Jump to

Keyboard shortcuts

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