version

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version provides build-time version information for GoatFlow. These variables are set at build time via -ldflags.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the GoatFlow release this source tree is (e.g. "0.10.0").
	Version = "0.10.0"

	// GitCommit is the short git commit SHA
	GitCommit = "unknown"

	// GitBranch is the git branch name
	GitBranch = "unknown"

	// BuildDate is the build timestamp
	BuildDate = "unknown"
)

Version is set in source by scripts/prepare-release.sh (never via ldflags) and checked against the release tag in CI. The other three are injected by the Dockerfile with -ldflags -X.

Functions

func Full

func Full() string

Full returns the full version string with all details.

func HostCompatible added in v0.10.0

func HostCompatible(minVersion string) bool

HostCompatible reports whether the running GoatFlow satisfies a plugin's minimum host version. An empty minimum always matches. A development build (Version "dev", empty, or any non-semver branch name) matches everything, so untagged builds never lock plugins out.

func RequireHost added in v0.10.0

func RequireHost(plugin, pluginVersion, minVersion string) error

RequireHost returns an *IncompatibleError when the running GoatFlow does not satisfy minVersion (see HostCompatible), nil otherwise.

func Short

func Short() string

Short returns just the version or branch name.

func String

func String() string

String returns a human-readable version string. Format: "v0.5.1 (abc1234)" or "main (abc1234)" for non-tagged builds

Types

type IncompatibleError added in v0.10.0

type IncompatibleError struct {
	Plugin         string
	PluginVersion  string
	MinHostVersion string
	HostVersion    string
}

IncompatibleError reports a plugin version whose minimum GoatFlow version is newer than the running host.

func (*IncompatibleError) Error added in v0.10.0

func (e *IncompatibleError) Error() string

type Info

type Info struct {
	Version   string `json:"version"`
	GitCommit string `json:"git_commit"`
	GitBranch string `json:"git_branch"`
	BuildDate string `json:"build_date"`
	GoVersion string `json:"go_version"`
}

Info contains structured version information.

func GetInfo

func GetInfo() Info

GetInfo returns the current version info.

Jump to

Keyboard shortcuts

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