version

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildTime = "unknown"

BuildTime is the build timestamp in RFC3339 format. Set via ldflags: -X github.com/hrygo/divinesense/internal/version.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)

View Source
var DevVersion = Version

DevVersion is the service current development version.

View Source
var GitBranch = "unknown"

GitBranch is the git branch at build time. Set via ldflags: -X github.com/hrygo/divinesense/internal/version.GitBranch=$(git rev-parse --abbrev-ref HEAD)

View Source
var GitCommit = "unknown"

GitCommit is the git commit hash at build time. Set via ldflags: -X github.com/hrygo/divinesense/internal/version.GitCommit=$(git rev-parse HEAD)

View Source
var Version = "0.0.0-dev"

Version is the service current released version. This value can be overridden at build time using ldflags:

go build -ldflags "-X github.com/hrygo/divinesense/internal/version.Version=v0.95.0"

Semantic versioning: https://semver.org/

Functions

func GetCurrentVersion

func GetCurrentVersion(mode string) string

func GetMinorVersion

func GetMinorVersion(version string) string

GetMinorVersion extracts the minor version (e.g., "0.25") from a full version string (e.g., "0.25.1"). Returns the minor version string or empty string if the version format is invalid. Version format should be "major.minor.patch" (e.g., "0.25.1").

func IsVersionGreaterOrEqualThan

func IsVersionGreaterOrEqualThan(version, target string) bool

IsVersionGreaterOrEqualThan returns true if version is greater than or equal to target.

func IsVersionGreaterThan

func IsVersionGreaterThan(version, target string) bool

IsVersionGreaterThan returns true if version is greater than target.

func String added in v0.94.0

func String() string

String returns the version string with optional commit hash.

func StringFull added in v0.94.0

func StringFull() string

StringFull returns the complete version information including build metadata.

Types

type SortVersion

type SortVersion []string

func (SortVersion) Len

func (s SortVersion) Len() int

func (SortVersion) Less

func (s SortVersion) Less(i, j int) bool

func (SortVersion) Swap

func (s SortVersion) Swap(i, j int)

Jump to

Keyboard shortcuts

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