Files
open-save-cloud-server/server/system.go
Aurélie Delhaie c06843cd28 Start refactoring
2023-05-29 17:44:50 +02:00

29 lines
718 B
Go

package server
import (
"net/http"
"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 (s *HTTPServer) Information(w http.ResponseWriter, r *http.Request) {
info := information{
AllowRegister: s.config.Features.AllowRegister,
Version: constant.Version,
APIVersion: constant.ApiVersion,
GoVersion: runtime.Version(),
OSName: runtime.GOOS,
OSArchitecture: runtime.GOARCH,
}
ok(info, w)
}