version

package
v0.0.100 Latest Latest
Warning

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

Go to latest
Published: May 7, 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

func UserAgent added in v0.0.93

func UserAgent() string

UserAgent is the canonical product identifier this binary uses on outbound requests (HLS / HTTP-TS / RTSP pulls). Downstream servers surface this string in their play-session dashboards, so a stable "Open-Streamer/<version>" form makes our pulls identifiable in other operators' tooling.

Format follows RFC 9110 §10.1.5 product-token convention "<product>/<product-version>". When Version is the placeholder "dev" (unstamped local build) we still emit it — operators want to see that a dev build is calling them rather than guess.

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