git

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveIsLatest added in v0.6.0

func ResolveIsLatest(r VersionResolver, vr version.Resolver, versionRange string) (bool, error)

ResolveIsLatest will resolve is version given by version.Resolver is the latest one in given version range, using a logic of git.VersionResolver.

Types

type IsLatestStrategy added in v0.6.0

type IsLatestStrategy func(version.Resolver) func(string) (bool, error)

IsLatestStrategy is used to determine if current version is latest one.

type Remote added in v0.6.0

type Remote struct {
	Name string
	URL  string
}

Remote represents a remote repository name and address.

type Repository added in v0.6.0

type Repository interface {
	// Describe will return an output that closely matches that of
	// "git describe --tags --always --dirty" for given repository.
	Describe() (string, error)
	// Tags will return repository tags.
	Tags() ([]string, error)
}

Repository gives information about the git SCM repository.

type StaticRepository added in v0.6.0

type StaticRepository struct {
	DescribeString string
	TagsSet        strings.Set
}

StaticRepository is stub repo implementation which gives back values provided to it upfront.

func (StaticRepository) Describe added in v0.6.0

func (s StaticRepository) Describe() (string, error)

func (StaticRepository) Tags added in v0.6.0

func (s StaticRepository) Tags() ([]string, error)

type VersionResolver added in v0.6.0

type VersionResolver struct {
	Cache cache.Cache
	IsLatestStrategy
	Repository
	*Remote
}

VersionResolver implements version.Resolver for git SCM.

func NewVersionResolver added in v0.6.0

func NewVersionResolver(options ...VersionResolverOption) VersionResolver

func (VersionResolver) IsLatest added in v0.6.0

func (r VersionResolver) IsLatest(versionRange string) (bool, error)

func (VersionResolver) TagBasedIsLatestStrategy added in v0.6.0

func (r VersionResolver) TagBasedIsLatestStrategy(vr version.Resolver) func(versionRange string) (bool, error)

TagBasedIsLatestStrategy is the default strategy, that uses a repository tags to determine if given version is latest within version range given.

func (VersionResolver) Version added in v0.6.0

func (r VersionResolver) Version() string

type VersionResolverOption added in v0.6.0

type VersionResolverOption func(*VersionResolver)

func WithCache added in v0.6.0

func WithCache(cache cache.Cache) VersionResolverOption

func WithIsLatestStrategy added in v0.6.0

func WithIsLatestStrategy(strategy IsLatestStrategy) VersionResolverOption

func WithRemote added in v0.6.0

func WithRemote(remote Remote) VersionResolverOption

func WithRepository added in v0.6.0

func WithRepository(repository Repository) VersionResolverOption

Jump to

Keyboard shortcuts

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