version

package
v1.5.27 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: GPL-3.0 Imports: 9 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version - The semantic version in string form
	Version string

	// GoVersion - Go compiler version
	GoVersion string

	// GitCommit - The commit id at compile time
	GitCommit string

	// GitDirty - Was the commit dirty at compile time
	GitDirty string

	// CompiledAt - When was this binary compiled
	CompiledAt string
)
View Source
var (
	// GithubReleasesURL - Check this Github releases API for updates
	GithubReleasesURL string
)

Functions

func Compiled

func Compiled() (time.Time, error)

Compiled - Get time this binary was compiled

func FullVersion

func FullVersion() string

FullVersion - Full version string

func SemanticVersion

func SemanticVersion() []int

SemanticVersion - Get the structured sematic version

Types

type Asset added in v1.2.1

type Asset struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	URL  string `json:"url"`
	Size int    `json:"size"`

	BrowserDownloadURL string `json:"browser_download_url"`
}

Asset - Asset from a release https://developer.github.com/v3/repos/releases/

type Release

type Release struct {
	ID          int     `json:"id"`
	Name        string  `json:"name"`
	URL         string  `json:"url"`
	HTMLURL     string  `json:"html_url"`
	TagName     string  `json:"tag_name"`
	Body        string  `json:"body"`
	Prerelease  bool    `json:"prerelease"`
	TarballURL  string  `json:"tarball_url"`
	ZipballURL  string  `json:"zipball_url"`
	CreatedAt   string  `json:"created_at"`
	PublishedAt string  `json:"published_at"`
	Assets      []Asset `json:"assets"`
}

Release - A single Github release object https://developer.github.com/v3/repos/releases/

func CheckForUpdates

func CheckForUpdates(client *http.Client, prereleases bool) (*Release, error)

CheckForUpdates - Checks Github releases for newer versions, if any error occurs we don't really try to recover. If client is nil we just use the Go default client with default settings.

func (*Release) Created

func (r *Release) Created() (time.Time, error)

Created - Get the time the release was created

func (*Release) Published

func (r *Release) Published() (time.Time, error)

Published - Get the time the release was published

Jump to

Keyboard shortcuts

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