version

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MPL-2.0 Imports: 3 Imported by: 105

Documentation

Overview

Package version helps plugin creators set and track the plugin version using the same convenience functions used by the Packer core.

Index

Constants

This section is empty.

Variables

View Source
var GitCommit string

The git commit that was compiled. This will be filled in by the compiler.

SDKVersion is used by the plugin set to allow Packer to recognize what version of the sdk the plugin is.

View Source
var Version = "0.4.0"

Package version helps plugin creators set and track the sdk version using

View Source
var VersionPrerelease = ""

A pre-release marker for the version. If this is "" (empty string) then it means that it is a final release. Otherwise, this is a pre-release such as "dev" (in development), "beta", "rc1", etc.

Functions

This section is empty.

Types

type PluginVersion

type PluginVersion struct {
	// contains filtered or unexported fields
}

func InitializePluginVersion

func InitializePluginVersion(vers, versionPrerelease string) *PluginVersion

InitializePluginVersion initializes the SemVer and returns a version var. If the provided "version" string is not valid, the call to version.Must will panic. Therefore, this function should always be called in a package init() function to make sure that plugins are following proper semantic versioning and to make sure that plugins which aren't following proper semantic versioning crash immediately rather than later.

func (*PluginVersion) FormattedVersion

func (p *PluginVersion) FormattedVersion() string

func (*PluginVersion) GetVersion

func (p *PluginVersion) GetVersion() string

func (*PluginVersion) GetVersionPrerelease

func (p *PluginVersion) GetVersionPrerelease() string

func (*PluginVersion) SemVer

func (p *PluginVersion) SemVer() *version.Version

func (*PluginVersion) String

func (p *PluginVersion) String() string

String returns the complete version string, including prerelease

Jump to

Keyboard shortcuts

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