Documentation
¶
Overview ¶
Package release describes the running build independently of data formats.
@facet: delivery/distribution/build-identity @facet-role: primary
Index ¶
Constants ¶
const ( OriginFacetCache = "facet-cache" OriginNPM = "npm" OriginUnmanaged = "unmanaged" )
Install origins of the running executable. They are facts about where this file was found, not about how it was built: the same build can be installed by the dispatcher, shipped in an npm package or copied onto PATH.
const InstallManifest = "install.json"
InstallManifest is the file the dispatcher bin/facet writes beside each Core binary it installs under $BASE/dist/core/<distribution>/<platform>/<version>/.
Variables ¶
var Distribution, SourceCommit, Dirty, BuildTime, BuildChannel string
These fields may be set through Go linker flags by build tooling. Empty metadata remains unknown; an arbitrary legacy -X main.version never establishes provenance.
Functions ¶
This section is empty.
Types ¶
type Compatibility ¶
type Compatibility struct {
TargetVersion string `json:"target_version"`
SpecificationVersion string `json:"specification_version"`
CompatibleSpecifications []string `json:"compatible_specifications"`
RecordSchemaVersions []string `json:"record_schema_versions"`
ProductProtocol int `json:"product_protocol"`
}
func Supported ¶
func Supported() Compatibility
type Identity ¶
type Identity struct {
Product string `json:"product"`
Version string `json:"version"`
Distribution string `json:"distribution"`
Channel string `json:"channel"`
SourceCommit string `json:"source_commit,omitempty"`
Dirty *bool `json:"dirty"`
// BuildTime is the stamped build time (release builds stamp the commit
// time), or Go's vcs.time, normalised to RFC3339 UTC. Unknown stays absent.
BuildTime string `json:"build_time,omitempty"`
Compatibility Compatibility `json:"compatibility"`
// AtlasVersion and UIVersion are set only by a distribution that bundles
// Atlas, a separate product, with this CLI. A Core build leaves both empty,
// and an empty value is omitted rather than reported as a version.
AtlasVersion string `json:"atlas_version,omitempty"`
UIVersion string `json:"ui_version,omitempty"`
}
type Install ¶
type Install struct {
Origin string `json:"origin"`
Path string `json:"path"`
// Distribution and Version are carried from install.json for facet-cache.
Distribution string `json:"distribution,omitempty"`
Version string `json:"version,omitempty"`
// Note explains why an origin was not established, e.g. an install.json
// that exists but cannot be trusted. Absent when nothing needs explaining.
Note string `json:"note,omitempty"`
}
Install says where the running executable lives and which installer owns it. It is kept apart from Identity on purpose: Identity is fixed at build time, while Install depends on the file the process was started from.
@facet: delivery/distribution/install-origin @facet-role: primary
func ClassifyInstall ¶
ClassifyInstall classifies an already resolved executable path.
func CurrentInstall ¶
func CurrentInstall() Install
CurrentInstall classifies the executable of this process after resolving symlinks, so a link on PATH reports the install it points to.