Documentation
¶
Overview ¶
Package source resolves Git repository references through explicit local maps or declared cache-backed acquisition.
Index ¶
- func CanonicalGitURLKey(raw string) string
- func DefaultGitCacheDir() (string, error)
- func GitCacheKey(repoURL, revision string) string
- func GitRevisionCandidates(revision string) []plumbing.Revision
- func IsCommitSHA(rev string) bool
- func IsDefaultRevision(rev string) bool
- func NormalizeURL(input string) string
- func RedactGitCredentialError(message string, credentials GitCredentials) string
- func RedactURL(input string) string
- func ResolveGitRevision(repo *git.Repository, revision string) (*plumbing.Hash, error)
- type DefaultGitAcquirer
- type GitAcquirer
- type GitCredentials
- type GitOptions
- type GitRequest
- type GitResult
- type Options
- type RepoMap
- type ResolvedRepository
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalGitURLKey ¶ added in v0.2.5
CanonicalGitURLKey reduces a git URL to "host/path" for self-repo matching ONLY: lowercase host, strip scheme/userinfo/port, convert scp-style git@host:x/y, trim ".git" and trailing slashes. It must never feed GitCacheKey, NormalizeURL consumers, or render-cache locators — it is a matching key, not a cache key (changing NormalizeURL would invalidate persistent caches; NormalizeURL stays untouched).
func DefaultGitCacheDir ¶
func GitCacheKey ¶
func GitRevisionCandidates ¶
func IsCommitSHA ¶ added in v0.2.5
IsCommitSHA reports whether rev is a full 40- or 64-char lowercase-hex id.
func IsDefaultRevision ¶ added in v0.2.5
IsDefaultRevision reports whether rev requests the default branch.
func NormalizeURL ¶
func RedactGitCredentialError ¶
func RedactGitCredentialError(message string, credentials GitCredentials) string
func ResolveGitRevision ¶
Types ¶
type DefaultGitAcquirer ¶
type DefaultGitAcquirer struct{}
func (DefaultGitAcquirer) Acquire ¶
func (DefaultGitAcquirer) Acquire(ctx context.Context, request GitRequest, opts GitOptions) (GitResult, error)
type GitAcquirer ¶
type GitAcquirer interface {
Acquire(ctx context.Context, request GitRequest, opts GitOptions) (GitResult, error)
}
type GitCredentials ¶
type GitOptions ¶
type GitOptions struct {
AllowNetwork bool
CacheDir string
Refresh bool
Credentials GitCredentials
}
type GitRequest ¶
type ResolvedRepository ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}