Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveIsLatest ¶
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 ¶
IsLatestStrategy is used to determine if current version is latest one.
type Repository ¶
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 ¶
StaticRepository is stub repo implementation which gives back values provided to it upfront.
func (StaticRepository) Describe ¶
func (s StaticRepository) Describe() (string, error)
func (StaticRepository) Tags ¶
func (s StaticRepository) Tags() ([]string, error)
type VersionResolver ¶
type VersionResolver struct { Cache cache.Cache IsLatestStrategy Repository *Remote }
VersionResolver implements version.Resolver for git SCM.
func NewVersionResolver ¶
func NewVersionResolver(options ...VersionResolverOption) VersionResolver
func (VersionResolver) IsLatest ¶
func (r VersionResolver) IsLatest(versionRange string) (bool, error)
func (VersionResolver) TagBasedIsLatestStrategy ¶
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 ¶
func (r VersionResolver) Version() string
type VersionResolverOption ¶
type VersionResolverOption func(*VersionResolver)
func WithCache ¶
func WithCache(cache cache.Cache) VersionResolverOption
func WithIsLatestStrategy ¶
func WithIsLatestStrategy(strategy IsLatestStrategy) VersionResolverOption
func WithRemote ¶
func WithRemote(remote Remote) VersionResolverOption
func WithRepository ¶
func WithRepository(repository Repository) VersionResolverOption
Click to show internal directories.
Click to hide internal directories.