version

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package version provides build version information.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version of the build.
	Version = "dev"

	// GitCommit is the git commit hash of the build.
	GitCommit = "unknown"

	// BuildTime is the time the build was created.
	BuildTime = "unknown"
)

These variables are set at build time via ldflags.

Functions

func Clean added in v0.3.0

func Clean(v string) string

Clean strips a leading "v" prefix from a version string.

func Fprint added in v0.30.0

func Fprint(w io.Writer, name string, asJSON bool) error

Fprint writes version information for the named binary to w. When asJSON is true it writes the indented JSON form of Info; otherwise it writes a single human-readable line.

func Info added in v0.30.0

func Info() map[string]string

Info returns the build version fields as a map suitable for JSON output.

func IsNewer added in v0.3.0

func IsNewer(local, remote string) bool

IsNewer returns true if remote is a newer semver than local. Handles "dev" and "unknown" gracefully — local "dev" always considers remote newer.

func UserAgent added in v0.5.0

func UserAgent() string

UserAgent returns the User-Agent string for outbound HTTP requests.

Types

type Transport added in v0.5.0

type Transport struct {
	Base http.RoundTripper
}

Transport wraps an http.RoundTripper to inject the panda User-Agent header.

func (*Transport) RoundTrip added in v0.5.0

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper.

Jump to

Keyboard shortcuts

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