version

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BoundaryPrefix = "Boundary v"

Variables

View Source
var (
	// GitCommit is the git commit that was compiled. This will be filled in by the compiler.
	GitCommit   string
	GitDescribe string

	// CgoEnabled is whether cgo is enabled or not; set at build time
	CgoEnabled bool

	// Version is the base version
	// Default values - set when building locally (at build time)
	Version = "0.12.0"

	// VersionPrerelease is also set at compile time, similarly to Version.
	VersionPrerelease = ""

	// VersionMetadata is also set at compile time.
	VersionMetadata = ""
)
View Source
var Binary *gvers.Version

Binary is the version of the running binary. This can be used for feature checks.

Functions

func Check added in v0.12.0

func Check(binaryVersion *gvers.Version, featureConstraint MetadataConstraint) bool

Check returns a bool indicating if a version satisfies the feature constraints

func EnableFeatureForTest added in v0.12.0

func EnableFeatureForTest(t *testing.T, feature Feature)

EnableFeatureForTest enables a feature for the current binary version

func EnableFeatureOnVersionForTest added in v0.12.0

func EnableFeatureOnVersionForTest(t *testing.T, version *gvers.Version, feature Feature)

EnableFeatureForTest modifies the feature map to enable a feature for a version. This is intended to be used for testing before release of a version Test cleanup will reset the feature map to the original feature constraint Note: running any tests in parallel while using this function WILL result in surprising behavior because this modifies the global feature map

func GetReleaseVersion added in v0.12.0

func GetReleaseVersion() (*gvers.Version, error)

GetReleaseVersion returns a go-version of this binary's Boundary version

func SupportsFeature added in v0.12.0

func SupportsFeature(version *gvers.Version, feature Feature) bool

SupportsFeature return a bool indicating whether or not this version supports the given feature

Types

type Feature added in v0.12.0

type Feature int
const (
	UnknownFeature Feature = iota
	MultiHopSessionFeature
	IncludeStatusInCli
	CredentialLibraryVaultSubtype
	UseTargetIdForHostId
)

type Info

type Info struct {
	Revision          string `json:"revision,omitempty"`
	Version           string `json:"version,omitempty"`
	VersionPrerelease string `json:"version_prerelease,omitempty"`
	VersionMetadata   string `json:"version_metadata,omitempty"`
	CgoEnabled        bool   `json:"cgo_enabled,omitempty"`
}

Info

func FromVersionString added in v0.12.0

func FromVersionString(s string) *Info

FromVersionString returns an *Info containing the version, or nil if the string was unable to be parsed.

func Get

func Get() *Info

func (*Info) FullVersionNumber

func (c *Info) FullVersionNumber(rev bool) string

func (*Info) Semver added in v0.12.0

func (c *Info) Semver() *gvers.Version

Semver returns a *gvers.Version if the Info is parseable as a semantic version. Otherwise it returns nil.

func (*Info) VersionNumber

func (c *Info) VersionNumber() string

type Metadata added in v0.12.0

type Metadata int
const (
	OSS Metadata = iota
	HCP
)

type MetadataConstraint added in v0.12.0

type MetadataConstraint struct {
	MetaInfo    []Metadata
	Constraints gvers.Constraints
}

func (MetadataConstraint) Check added in v0.12.0

func (m MetadataConstraint) Check(version *gvers.Version) bool

Check returns a bool indicating if a version meets the metadata constraint for a feature. Check returns false if version is nil.

Jump to

Keyboard shortcuts

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