Documentation ¶
Overview ¶
Package version helps plugin creators set and track the plugin version using the same convenience functions used by the Packer core.
Index ¶
- Variables
- type PluginVersion
- func (p *PluginVersion) FormattedVersion() string
- func (p *PluginVersion) GetMetadata() string
- func (p *PluginVersion) GetVersion() string
- func (p *PluginVersion) GetVersionPrerelease() string
- func (p *PluginVersion) SemVer() *version.Version
- func (p *PluginVersion) SetMetadata(meta string)
- func (p *PluginVersion) String() string
Constants ¶
This section is empty.
Variables ¶
var GitCommit string
The git commit that was compiled. This will be filled in by the compiler.
var SDKVersion = NewPluginVersion(Version, VersionPrerelease, VersionMetadata)
SDKVersion is used by the plugin set to allow Packer to recognize what version of the sdk the plugin is.
var Version = "0.5.4"
Package version helps plugin creators set and track the sdk version using
var VersionMetadata = ""
The metadata for the version, this is optional information to add around a particular release.
This has no impact on the ordering of plugins, and is ignored for non-human eyes.
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
deprecated
func InitializePluginVersion(vers, versionPrerelease string) *PluginVersion
InitializePluginVersion initializes the SemVer and returns a version var.
Deprecated: InitializePluginVersion does not support metadata out of the box, and should be replaced by either NewPluginVersion or NewRawVersion.
func NewPluginVersion ¶ added in v0.5.3
func NewPluginVersion(vers, versionPrerelease, versionMetadata string) *PluginVersion
NewPluginVersion initializes the SemVer and returns a PluginVersion from it. If the provided "version" string is not valid, the call to version.Must will panic.
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.
If the core version number is empty, it will default to 0.0.0.
func NewRawVersion ¶ added in v0.5.3
func NewRawVersion(rawSemVer string) *PluginVersion
NewRawVersion is made for more freeform version strings. It won't accept much more than what `NewPluginVersion` already does, but is another convenient form to create a version if preferred.
As NewRawVersion, if the version is invalid, it will panic.
func (*PluginVersion) FormattedVersion ¶
func (p *PluginVersion) FormattedVersion() string
func (*PluginVersion) GetMetadata ¶ added in v0.5.3
func (p *PluginVersion) GetMetadata() 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) SetMetadata ¶ added in v0.5.3
func (p *PluginVersion) SetMetadata(meta string)
func (*PluginVersion) String ¶
func (p *PluginVersion) String() string
String returns the complete version string, including prerelease