facts: add APIVersion constant
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
|||||||
"github.com/zcalusic/sysinfo"
|
"github.com/zcalusic/sysinfo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const APIVersion string = "facts/v1alpha1"
|
||||||
|
|
||||||
type FactsResponse struct {
|
type FactsResponse struct {
|
||||||
APIVersion string `json:"apiVersion"`
|
APIVersion string `json:"apiVersion"`
|
||||||
CPUInfo sysinfo.CPU `json:"cpu"`
|
CPUInfo sysinfo.CPU `json:"cpu"`
|
||||||
@@ -24,7 +26,7 @@ func GetFacts(next http.Handler) http.Handler {
|
|||||||
|
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
resp := FactsResponse{
|
resp := FactsResponse{
|
||||||
APIVersion: "v1",
|
APIVersion: APIVersion,
|
||||||
CPUInfo: si.CPU,
|
CPUInfo: si.CPU,
|
||||||
BoardInfo: si.Board,
|
BoardInfo: si.Board,
|
||||||
DeviceInfo: si.Product,
|
DeviceInfo: si.Product,
|
||||||
|
|||||||
Reference in New Issue
Block a user