package handler import ( "net/http" "github.com/gin-gonic/gin" ) // VersionResponse is the response body for the version endpoint. type VersionResponse struct { Version string `json:"version"` } // VersionHandler serves application version metadata. type VersionHandler struct { version string } // NewVersionHandler creates a version handler. func NewVersionHandler(appVersion string) *VersionHandler { return &VersionHandler{version: appVersion} } // Get writes the current application version. func (h *VersionHandler) Get(c *gin.Context) { c.JSON(http.StatusOK, VersionResponse{Version: h.version}) }