Documentation
¶
Overview ¶
Package version exposes build metadata for the running dbrain binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ReleaseVersion = "unknown" BuildPlatform = "unknown" SecurityBaselineID = "v0.6.0-security-pass" SecurityBaselineEpoch = 1 // GitVersion is kept as a deprecated fallback for older build scripts that // used this misleading name for release/tag metadata. GitVersion = "unknown" )
ReleaseVersion and BuildPlatform are injected by release/build commands because Go build info does not include them.
Functions ¶
func ClassifySecurityBaseline ¶ added in v0.7.0
ClassifySecurityBaseline validates a literal ID/epoch pair against the compiled ordered registry. Labels are never compared lexically.
func GetCommit ¶
func GetCommit() string
GetCommit returns the full git commit SHA when build info includes it.
func Info ¶
func Info() map[string]interface{}
Info returns version information as a map for API-style payloads.
func ShortCommit ¶
func ShortCommit() string
ShortCommit returns the first seven characters of the current commit.
func StartupLine ¶
func StartupLine() string
StartupLine returns a concise human-readable build identifier for startup logs.
Types ¶
type Details ¶
type Details struct {
Commit string `json:"commit"`
Short string `json:"short"`
BuildTime string `json:"build_time"`
GitStatus string `json:"git_status"`
GoVersion string `json:"go_version"`
ReleaseVersion string `json:"release_version"`
BuildPlatform string `json:"build_platform"`
SecurityBaselineID string `json:"security_baseline"`
SecurityBaselineEpoch int `json:"security_baseline_epoch"`
ModulePath string `json:"module_path,omitempty"`
ModuleVersion string `json:"module_version,omitempty"`
BuildSettings map[string]string `json:"build_settings,omitempty"`
}
Details describes build and version metadata embedded in the binary.