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 ¶
const Version = "0.0.8"
Package version helps plugin creators set and track the sdk version using
const 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.
Variables ¶
var GitCommit string
The git commit that was compiled. This will be filled in by the compiler.
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