Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Hash is the VCS hash the binary was built from. Hash string // Tag is the VCS tag the binary was built from. Tag string // Branch is the VCS branch the binary was built from. Branch string // Timestamp is the time the binary was built. Timestamp string // Handler is an http.Handler that exposes the versioning // information as an endpoint. Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { contentType := goautoneg.Negotiate(r.Header.Get("Accept"), []string{"application/json"}) if contentType == "application/json" { w.Header().Set("Content-Type", "application/json") w.Write(jsonOutput) return } w.Write([]byte("VERSION_HASH=\"" + Hash + "\"\nVERSION_TAG=\"" + Tag + "\"\nVERSION_BRANCH=\"" + Branch + "\"\nVERSION_TIME=\"" + Timestamp + "\"")) }) )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.