version

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package version provides build-time version information for Tinct. Version information is injected at build time using ldflags.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version of the application.
	// Injected at build time via: -ldflags "-X github.com/jmylchreest/tinct/internal/version.Version=x.y.z".
	Version = "0.0.0"

	// Commit is the git commit hash of the build.
	// Injected at build time via: -ldflags "-X github.com/jmylchreest/tinct/internal/version.Commit=$(git rev-parse HEAD)".
	Commit = "unknown"

	// Date is the build date in RFC3339 format.
	// Injected at build time via: -ldflags "-X github.com/jmylchreest/tinct/internal/version.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)".
	Date = "unknown"

	// TelemetryAppKey is the statsfactory API key for telemetry.
	// Injected at build time via: -ldflags "-X github.com/jmylchreest/tinct/internal/version.TelemetryAppKey=sf_live_...".
	// Can be overridden at runtime by the TINCT_TELEMETRY_APP_KEY environment variable.
	TelemetryAppKey = ""

	// TelemetryServerURL is the statsfactory server URL for telemetry.
	// Injected at build time via: -ldflags "-X github.com/jmylchreest/tinct/internal/version.TelemetryServerURL=https://...".
	// Can be overridden at runtime by the TINCT_TELEMETRY_SERVER_URL environment variable.
	TelemetryServerURL = ""

	// GoVersion is the Go version used to build the binary.
	GoVersion = runtime.Version()
)

Functions

func GetTelemetryAppKey added in v0.2.0

func GetTelemetryAppKey() string

GetTelemetryAppKey returns the telemetry app key, preferring the environment variable TINCT_TELEMETRY_APP_KEY over the build-time injected value.

func GetTelemetryServerURL added in v0.2.0

func GetTelemetryServerURL() string

GetTelemetryServerURL returns the telemetry server URL, preferring the environment variable TINCT_TELEMETRY_SERVER_URL over the build-time injected value.

func Short

func Short() string

Short returns a short version string suitable for CLI output.

func String

func String() string

String returns a human-readable version string.

Types

type Info

type Info struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	Date      string `json:"date"`
	GoVersion string `json:"go_version"`
	Platform  string `json:"platform"`
}

Info holds all version information for the application.

func GetInfo

func GetInfo() Info

GetInfo returns all version information as a structured type.

Jump to

Keyboard shortcuts

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