buildinfo

package
v1.509.24 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Variables in this file will be replaced by the linker when Bazel is run with --stamp The time should be in format '2018-12-12 12:30:00 UTC' The GitStatus should be either "clean" or "dirty" Release will be a comma-separated string representation of any tags.

Index

Constants

View Source
const (
	// Git status
	CleanGitStatus = "clean"

	// Release values
	PreStampRelease = "no release"

	// Version constants
	NotCleanVersionSuffix = " (with local changes)"
	NoReleaseVersion      = "unknown [not built with --stamp]"
)

Variables

View Source
var BuildTime = "an unknown time"

BuildTime is a string representation of when this binary was built.

View Source
var GitCommit = "an unknown revision"

GitCommit is the revision this binary was built from.

View Source
var GitStatus = "unknown"

GitStatus is whether the git workspace was clean.

View Source
var HostName = "an unknown machine"

HostName is the machine where this binary was built.

View Source
var IsAspectPro = ""

IsAspectPro indicates if this is an Aspect CLI Pro build

View Source
var Release = "no release"

Release is the revision number, if any.

Functions

func IsStamped

func IsStamped() bool

Types

type BuildInfo

type BuildInfo struct {
	BuildTime   string
	HostName    string
	GitCommit   string
	GitStatus   string
	Release     string
	IsAspectPro bool
}

func Current

func Current() *BuildInfo

func New

func New(
	buildTime string,
	hostName string,
	gitCommit string,
	gitStatus string,
	release string,
	pro bool,
) *BuildInfo

func (BuildInfo) CommandVersion

func (bi BuildInfo) CommandVersion(format VersionFormat) string

func (BuildInfo) GnuName added in v1.0.1

func (bi BuildInfo) GnuName() string

func (BuildInfo) HasRelease

func (bi BuildInfo) HasRelease() bool

func (BuildInfo) IsClean

func (bi BuildInfo) IsClean() bool

func (BuildInfo) Name added in v1.0.1

func (bi BuildInfo) Name() string

func (BuildInfo) Version

func (bi BuildInfo) Version() string

type VersionFormat

type VersionFormat int
const (
	// VersionFormat
	ConventionalFormat VersionFormat = iota
	GNUFormat
)

Jump to

Keyboard shortcuts

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