e0224419ec201e21eb474b4d93be0ba3e069c5a0
[src/xds/xds-agent.git] / lib / apiv1 / version.go
1 package apiv1
2
3 import (
4         "net/http"
5
6         "github.com/gin-gonic/gin"
7 )
8
9 type version struct {
10         Version       string `json:"version"`
11         APIVersion    string `json:"apiVersion"`
12         VersionGitTag string `json:"gitTag"`
13 }
14
15 // getInfo : return various information about server
16 func (s *APIService) getVersion(c *gin.Context) {
17         response := version{
18                 Version:       s.cfg.Version,
19                 APIVersion:    s.cfg.APIVersion,
20                 VersionGitTag: s.cfg.VersionGitTag,
21         }
22
23         c.JSON(http.StatusOK, response)
24 }