mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-05-10 19:46:34 +00:00
23 lines
485 B
Go
23 lines
485 B
Go
package http
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/stefanprodan/podinfo/pkg/version"
|
|
)
|
|
|
|
// Version godoc
|
|
// @Summary Version
|
|
// @Description returns podinfo version and git commit hash
|
|
// @Tags HTTP API
|
|
// @Produce json
|
|
// @Router /version [get]
|
|
// @Success 200 {object} api.MapResponse
|
|
func (s *Server) versionHandler(w http.ResponseWriter, r *http.Request) {
|
|
result := map[string]string{
|
|
"version": version.VERSION,
|
|
"commit": version.REVISION,
|
|
}
|
|
s.JSONResponse(w, r, result)
|
|
}
|