29 lines
718 B
Go
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)
|
|
}
|