This commit is contained in:
2025-05-15 00:46:57 +02:00
parent 30c71cb449
commit b2b27b2c3d
18 changed files with 622 additions and 234 deletions

26
cmd/server/api/system.go Normal file
View File

@@ -0,0 +1,26 @@
package api
import (
"cloudsave/pkg/constants"
"net/http"
"runtime"
)
type information struct {
Version string `json:"version"`
APIVersion int `json:"api_version"`
GoVersion string `json:"go_version"`
OSName string `json:"os_name"`
OSArchitecture string `json:"os_architecture"`
}
func (s *HTTPServer) Information(w http.ResponseWriter, r *http.Request) {
info := information{
Version: constants.Version,
APIVersion: constants.ApiVersion,
GoVersion: runtime.Version(),
OSName: runtime.GOOS,
OSArchitecture: runtime.GOARCH,
}
ok(info, w, r)
}