version

package
v0.0.25 Latest Latest
Warning

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

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

Documentation

Overview

Package version exposes build-time injected version metadata.

Variables are populated via -ldflags at build time:

go build -ldflags="\
    -X github.com/ntt0601zcoder/open-streamer/pkg/version.Version=v0.0.7 \
    -X github.com/ntt0601zcoder/open-streamer/pkg/version.Commit=abc1234 \
    -X github.com/ntt0601zcoder/open-streamer/pkg/version.BuiltAt=2026-04-23T15:00:00Z"

Defaults below ("dev"/"unknown"/"") apply when running via `go run` or for unstamped local builds. The Makefile `build` target wires all three.

Index

Constants

This section is empty.

Variables

View Source
var BuiltAt = ""

BuiltAt is the UTC RFC3339 timestamp of the build, or empty.

View Source
var Commit = "unknown"

Commit is the git commit SHA the binary was built from, or "unknown".

View Source
var Version = "dev"

Version is the release tag (vMAJ.MIN.PATCH), short SHA fallback, or "dev".

Functions

This section is empty.

Types

type Info

type Info struct {
	Version string `json:"version"`
	Commit  string `json:"commit"`
	BuiltAt string `json:"built_at,omitempty"`
}

Info bundles all version fields for JSON exposure (e.g. GET /config).

func Get

func Get() Info

Get returns the current build metadata as a value (safe to embed in JSON responses without exposing the underlying mutable globals).

Jump to

Keyboard shortcuts

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