version

package
v0.0.0-...-bda6563 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(releasesGetterFn ReleasesGetter, currentRelease string) (*semver.Version, error)

Check returns a newer version, or an error or nil for both if no error happened, and no updates are needed.

func GetGithubReleaseURL

func GetGithubReleaseURL(releasesURL string, v *semver.Version) string

func IsUnreleased

func IsUnreleased(version string) bool

IsUnreleased tells if the version in parameter is an unreleased version or not. An unreleased version is a development version from the semantic versioning point of view. This doesn't probe GitHub for its metadata on the version, and this is intended. A release flagged as a pre-release in GitHub is just to mark mainnet incompatibility.

Types

type ReleasesGetter

type ReleasesGetter func() ([]*Version, error)

ReleasesGetter return the list of releases as semantic version strings

func BuildGithubReleasesRequestFrom

func BuildGithubReleasesRequestFrom(ctx context.Context, releasesURL string) ReleasesGetter

type Version

type Version struct {
	Version       *semver.Version
	IsDraft       bool
	IsDevelopment bool
	IsPreReleased bool
	IsReleased    bool
}

func NewVersionFromString

func NewVersionFromString(release string) (*Version, error)

NewVersionFromString creates a Version and set the appropriate flags on it based on the segments that compose the version.

Jump to

Keyboard shortcuts

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