meta

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: BSD-3-Clause Imports: 3 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package meta serves what a running API knows about itself: its name, and the version and build of its binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(name string) http.Handler

Handler returns a handler that responds with the running binary's Info as JSON. Mount it at GET /meta.

Types

type Info

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.

func Read

func Read(name string) Info

Read returns the Info for the running binary, from its build information.

Jump to

Keyboard shortcuts

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