facts: add APIVersion constant
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
"github.com/zcalusic/sysinfo"
|
||||
)
|
||||
|
||||
const APIVersion string = "facts/v1alpha1"
|
||||
|
||||
type FactsResponse struct {
|
||||
APIVersion string `json:"apiVersion"`
|
||||
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) {
|
||||
resp := FactsResponse{
|
||||
APIVersion: "v1",
|
||||
APIVersion: APIVersion,
|
||||
CPUInfo: si.CPU,
|
||||
BoardInfo: si.Board,
|
||||
DeviceInfo: si.Product,
|
||||
|
||||
Reference in New Issue
Block a user