version

package
v1.138.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProductName is the official product name
	ProductName = "NFTBan"

	// CoreEngineName is the name of the core engine binary
	CoreEngineName = "nftban-core"
)

Core version constants - AUTO-GENERATED from Version

View Source
const (
	// SchemaVersion is the nftables schema version
	// This tracks changes to table/set/chain structure
	SchemaVersion = "0.7.3"

	// ConfigVersion is the configuration file format version
	ConfigVersion = "2"
)

Architecture version constants

Variables

View Source
var BuildDate = "unknown"

BuildDate is injected at build time (-X) with the build host's UTC timestamp. Format: RFC3339 (`2006-01-02T15:04:05Z`). Default "unknown" pairs with GitCommit="dev" to flag uninjected builds.

View Source
var GitCommit = "dev"

GitCommit is injected at build time (-X) with `git rev-parse HEAD` (typically the short SHA). Carries chain-of-custody for the binary back to the source commit. Default "dev" means "this binary was built without ldflag injection — do not trust the version string".

View Source
var Version = "dev"

Version is injected at build time from the repo VERSION file via -ldflags. If not set during build, defaults to "dev".

Functions

func Banner(component string) string

Banner returns a formatted banner string for CLI output

func BannerWithEmoji

func BannerWithEmoji(emoji, component string) string

BannerWithEmoji returns a banner with emoji prefix

func BuildTimestamp added in v1.100.4

func BuildTimestamp() string

BuildTimestamp returns the build-injected UTC timestamp, or "unknown" when the binary was built without ldflag injection.

func Commit added in v1.100.4

func Commit() string

Commit returns the build-injected git commit SHA, or "dev" when the binary was built without ldflag injection. Use this rather than reading the package var directly so tests can swap implementations in the future without mutating package state.

func FullVersion

func FullVersion() string

FullVersion includes the 'v' prefix (e.g., "v1.0.5")

func Line added in v1.100.4

func Line(component string) string

Line returns the canonical one-line --version string for the named binary component. All NFTBan binaries print this exact format so release/audit tooling can grep a stable shape:

<component> v<Version> (git <commit>, build <date>)

Examples:

nftband v1.100.4-dev (git 2d8bbc7c, build 2026-05-01T08:30:00Z)
nftban-core v1.100.4-dev (git dev, build unknown)   # uninjected

Component is the binary name (e.g., "nftband", "nftban-core", "nftban-installer", "nftban-validate"). Empty component prints the product name only.

func Major

func Major() int

Major returns the major version number

func Minor

func Minor() int

Minor returns the minor version number

func Patch

func Patch() int

Patch returns the patch version number

Types

This section is empty.

Jump to

Keyboard shortcuts

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