first commit

This commit is contained in:
Aurélie Delhaie
2022-05-08 14:08:27 +02:00
commit b20a53cc48
19 changed files with 611 additions and 0 deletions

29
server/system.go Normal file
View File

@@ -0,0 +1,29 @@
package server
import (
"net/http"
"opensavecloudserver/config"
"opensavecloudserver/constant"
"runtime"
)
type information struct {
AllowRegister bool `json:"allow_register"`
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 Information(w http.ResponseWriter, r *http.Request) {
info := information{
AllowRegister: config.Features().AllowRegister,
Version: constant.Version,
ApiVersion: constant.ApiVersion,
GoVersion: runtime.Version(),
OsName: runtime.GOOS,
OsArchitecture: runtime.GOARCH,
}
ok(info, w, r)
}