Documentation ¶
Overview ¶
Package version is used to expose the current version information as populated by the build process. With a default value of "unreleased" the `BuildMetadata` indicates that `Version` will likely be used as _next_ Git tag. During a build some or all of the variables my be overridden using the Go linker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Version is a "v" prefixed Semver, including pre-release information if applicable Version = defaultVersion // BuildMetadata is the Semver build metadata stored independent of the version string BuildMetadata = "" // GitCommit is a Git commit identifier GitCommit = "" )
Functions ¶
func UserAgent ¶
func UserAgent(product, comment string, transport http.RoundTripper) http.RoundTripper
UserAgent wraps the (possibly nil) transport so that it will set the user agent using the supplied product name and current version
Types ¶
type Info ¶
type Info struct { Version string `json:"version"` BuildMetadata string `json:"build"` GitCommit string `json:"gitCommit"` }
Info represents available version information
type Transport ¶
type Transport struct { // UserAgent string to use, defaults to "RedSky/{version}" if unset UserAgent string // Base transport to use, uses the system default if nil Base http.RoundTripper }
Transport sets the `User-Agent` header
Click to show internal directories.
Click to hide internal directories.