Documentation
¶
Index ¶
Constants ¶
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
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 ¶
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.
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".
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 BannerWithEmoji ¶
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 Line ¶ added in v1.100.4
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.
Types ¶
This section is empty.