Documentation ¶
Index ¶
- Constants
- Variables
- func Check(binaryVersion *gvers.Version, featureConstraint MetadataConstraint) bool
- func EnableFeatureForTest(t *testing.T, feature Feature)
- func EnableFeatureOnVersionForTest(t *testing.T, version *gvers.Version, feature Feature)
- func GetReleaseVersion() (*gvers.Version, error)
- func SupportsFeature(version *gvers.Version, feature Feature) bool
- type Feature
- type Info
- type Metadata
- type MetadataConstraint
Constants ¶
const BoundaryPrefix = "Boundary v"
Variables ¶
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 = "" )
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
EnableFeatureForTest enables a feature for the current binary version
func EnableFeatureOnVersionForTest ¶ added in v0.12.0
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
GetReleaseVersion returns a go-version of this binary's Boundary version
Types ¶
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
FromVersionString returns an *Info containing the version, or nil if the string was unable to be parsed.
func (*Info) FullVersionNumber ¶
func (*Info) Semver ¶ added in v0.12.0
Semver returns a *gvers.Version if the Info is parseable as a semantic version. Otherwise it returns nil.
func (*Info) VersionNumber ¶
type MetadataConstraint ¶ added in v0.12.0
type MetadataConstraint struct { MetaInfo []Metadata Constraints gvers.Constraints }