server
This commit is contained in:
26
cmd/server/api/system.go
Normal file
26
cmd/server/api/system.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user