-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcdp_user.go
35 lines (32 loc) · 976 Bytes
/
cdp_user.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"encoding/json"
"log"
"net/http"
)
type VersionInfoResponse struct {
Branch string `json:"BRANCH"`
BuildTime string `json:"BUILD_TIME"`
Commit string `json:"COMMIT"`
Dirty bool `json:"DIRTY"`
MinClientLibVersion []string `json:"MIN_CLIENT_LIB_VERSION"`
Name string `json:"NAME"`
Tag string `json:"TAG"`
Version []int `json:"VERSION"`
}
func VersionInfo(w http.ResponseWriter, _ *http.Request) {
resp := &VersionInfoResponse{
Branch: "release-1.51",
BuildTime: "Thu Sep 27 11:28:59 UTC 2018",
Commit: "e1180f512d7c5078404d88a610e5fbccfe645820",
Dirty: false,
MinClientLibVersion: []string{},
Name: "",
Tag: "",
Version: []int{1, 51, 1},
}
err := json.NewEncoder(w).Encode(resp)
if err != nil {
log.Println(err)
}
}