pkg

package
v0.0.0-...-56979a3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DefaultMainReferenceName plumbing.ReferenceName = "refs/heads/main"
	OriginName string     = "origin"
	MainBranch BranchName = "main"
)
View Source
const (
	NoRevision = "v0"
)

Variables

View Source
var (
	DefaultMainReferenceName plumbing.ReferenceName = plumbing.ReferenceName(branchPrefixInLocalRepo + "/" + string(MainBranch))
)

Functions

func AnnotateCommitMessage

func AnnotateCommitMessage(message string, annotation *gitAnnotation) (string, error)

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

func LatestRevisionNumber(revs []string) string

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

func NextRevisionNumber(revs []string) (string, error)

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

Jump to

Keyboard shortcuts

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