Categorygithub.com/andrewstuart/buildmeta
modulepackage
1.0.3
Repository: https://github.com/andrewstuart/buildmeta.git
Documentation: pkg.go.dev

# README

Buildmeta

An easy way to set ldflags and retain build-time metadata that is useful for Go applications running in any environment.

Getting Started

There are already a few applications out there with canonical paths for build metadata, though none thus far is authoritative. This package takes the idea and extends it to include a CLI that knows how to set ldflags appropriately so that all your build needs is -ldflags "$(buildmeta ldflags)". There are additional options for outputting JSON metadata for e.g. static directories.

To use this, run go install github.com/andrewstuart/buildmeta/cmd/buildmeta@latest in terminal, and run buildmeta to validate output. You can also try go run github.com/andrewstuart/buildmeta/cmd/buildmeta which will both download and run this module.

go build -o app -ldflags "$(buildmeta ldflags)"

# Packages

No description provided by the author

# Functions

GenerateInfo returns the *Info object per a given repoPath on the local filesystem.
GetInfo returns the Info object with the values that were set by ldflags during compilation.
Handler returns a MetaHandler, which serves up version information and any registered health checks at given endpoints.

# Constants

Well-known paths used by buildmeta.
Well-known paths used by buildmeta.
Well-known paths used by buildmeta.
Well-known paths used by buildmeta.
Well-known paths used by buildmeta.

# Structs

A DownstreamError is returned by the MetaChecker so that further details can be inspected in the output messages if it is json encoded.
Info is the type used by the buildmeta package to return build-time information.
MetaChecker is a health.Checker implementation that just abstracts over a simple base endpoint, and attempts to contact the buildmeta readiness probe under the well-known buildmeta path.
MetaHandler serves structured metadata for version control metadata, liveness, and readiness.