dummyapp: go.pennock.tech/dummyapp/internal/version Index | Files

package version

import "go.pennock.tech/dummyapp/internal/version"

Package version provides a home for metadata about the program, how it's running, what it's name is, and so forth. It should not depend upon any non-stdlib packages, so that it's safe for import anywhere in the project.

Index

Package Files

version.go

Constants

const Program = "dummyapp"

Program is our idea of the persistent name of the program, for use where we don't want to use argv[0]. It's exported so that this doesn't have to be repeated. Customize this if copying this code for use elsewhere!

Variables

var BuildTime string

BuildTime is potentially set at link-time. It should be used to record the timestamp (date+time) of the build.

func CurrentVersion Uses

func CurrentVersion() string

CurrentVersion provides the single-string derivation of what we consider our current version to be. It might be derived from multiple pieces of information, whatever we think makes sense. It probably fits on one line.

func PrintTo Uses

func PrintTo(w io.Writer)

PrintTo is used to write multiple whole lines of version information to an io.Writer. Contrast with LogPairs.

type LogPair Uses

type LogPair struct {
    Key, Value string
}

A LogPair is a simple Key,Value pair of strings, suitable for using in structured logging as one item.

func LogPairs Uses

func LogPairs() []LogPair

LogPairs returns a slice of items suitable for logging. It's roughly equivalent to PrintTo, but it's the caller's responsibility to iterate the slice and add each pair to the logging call.

Package version imports 4 packages (graph) and is imported by 3 packages. Updated 2018-06-13. Refresh now. Tools for package owners.