Package meta
Overview
Package meta serves what a running API knows about itself: its name, and the version and build of its binary.
Index
Functions
Handler source
func Handler(name string) http.HandlerHandler returns a handler that responds with the running binary's Info as JSON. Mount it at GET /meta.
Types
Info source
type Info struct {
// Name is the service's name.
Name string `json:"name"`
// Version is the main module's version, or "(devel)" for a binary not
// built by go install at a version.
Version string `json:"version,omitempty"`
// Revision is the VCS revision the binary was built from, if known.
Revision string `json:"revision,omitempty"`
// Modified reports whether the working tree had uncommitted changes.
Modified bool `json:"modified,omitempty"`
// GoVersion is the Go release that built the binary.
GoVersion string `json:"go_version,omitempty"`
}Info is the body of a meta response.
Read source
func Read(name string) InfoRead returns the Info for the running binary, from its build information.