Documentation ¶
Index ¶
- Constants
- Variables
- func AnnotateCommitMessage(message string, annotation *gitAnnotation) (string, error)
- func Close(ctx context.Context, cacheDir string, cr *configv1alpha1.Repository) error
- func GetGitAnnotation(pkgRev *pkgv1alpha1.PackageRevision) *gitAnnotation
- func IsFiltered(refName plumbing.ReferenceName, opt *repository.ListOption) bool
- func LatestRevisionNumber(revs []string) string
- func NextRevisionNumber(revs []string) (string, error)
- func OpenRepository(ctx context.Context, cacheDir string, cr *configv1alpha1.Repository, ...) (repository.Repository, error)
- type BranchName
- type DiscoverPackagesOptions
- type Options
- type TagName
Constants ¶
const ( //DefaultMainReferenceName plumbing.ReferenceName = "refs/heads/main" OriginName string = "origin" MainBranch BranchName = "main" )
const (
NoRevision = "v0"
)
Variables ¶
var (
DefaultMainReferenceName plumbing.ReferenceName = plumbing.ReferenceName(branchPrefixInLocalRepo + "/" + string(MainBranch))
)
Functions ¶
func AnnotateCommitMessage ¶
AnnotateCommitMessage adds the gitAnnotation to the commit message.
func Close ¶
func Close(ctx context.Context, cacheDir string, cr *configv1alpha1.Repository) error
func GetGitAnnotation ¶
func GetGitAnnotation(pkgRev *pkgv1alpha1.PackageRevision) *gitAnnotation
func IsFiltered ¶
func IsFiltered(refName plumbing.ReferenceName, opt *repository.ListOption) bool
packageFilter filters
func LatestRevisionNumber ¶
LatestRevisionNumber computes the latest revision number of a given list. This function only understands strict versioning format, e.g. v1, v2, etc. It will ignore all revision numbers it finds that do not adhere to this format. If there are no published revisions (in the recognized format), the revision number returned here will be "v0".
func NextRevisionNumber ¶
NextRevisionNumber computes the next revision number as the latest revision number + 1. This function only understands strict versioning format, e.g. v1, v2, etc. It will ignore all revision numbers it finds that do not adhere to this format. If there are no published revisions (in the recognized format), the revision number returned here will be "v1".
func OpenRepository ¶
func OpenRepository(ctx context.Context, cacheDir string, cr *configv1alpha1.Repository, opts *Options) (repository.Repository, error)
Types ¶
type BranchName ¶
type BranchName string
BranchName represents a relative branch name (i.e. 'main', 'drafts/bucket/v1') and supports transformation to the ReferenceName in local (cached) repository (those references are in the form 'refs/remotes/origin/...') or in the remote repository (those references are in the form 'refs/heads/...').
func (BranchName) BranchInLocal ¶
func (b BranchName) BranchInLocal() plumbing.ReferenceName
func (BranchName) BranchInRemote ¶
func (b BranchName) BranchInRemote() plumbing.ReferenceName
type DiscoverPackagesOptions ¶
type DiscoverPackagesOptions struct { // PackagePath restricts package discovery to a particular subdirectory, which is the // PackagePath or PackageName or BranchName // The subdirectory is not required to exist (we will return an empty package). PackagePath string // Recurse enables recursive traversal of the git tree. Recurse bool }
DiscoveryPackagesOptions holds the configuration for walking a git tree
type Options ¶
type Options struct { CredentialResolver auth.CredentialResolver UserInfoProvider auth.UserInfoProvider }
type TagName ¶
type TagName string
func (TagName) TagInLocal ¶
func (b TagName) TagInLocal() plumbing.ReferenceName
func (TagName) TagInRemote ¶
func (b TagName) TagInRemote() plumbing.ReferenceName