Port most of the HTTP code over to gin

This commit is contained in:
Dane Everitt
2020-04-05 18:00:33 -07:00
parent 223b9e05a1
commit cf2ef1a173
22 changed files with 1233 additions and 968 deletions

6
system/const.go Normal file
View File

@@ -0,0 +1,6 @@
package system
const (
// The current version of this software.
Version = "0.0.1"
)

31
system/system.go Normal file
View File

@@ -0,0 +1,31 @@
package system
import (
"github.com/docker/docker/pkg/parsers/kernel"
"runtime"
)
type Information struct {
Version string `json:"version"`
KernelVersion string `json:"kernel_version"`
Architecture string `json:"architecture"`
OS string `json:"os"`
CpuCount int `json:"cpu_count"`
}
func GetSystemInformation() (*Information, error) {
k, err := kernel.GetKernelVersion()
if err != nil {
return nil, err
}
s := &Information{
Version: Version,
KernelVersion: k.String(),
Architecture: runtime.GOARCH,
OS: runtime.GOOS,
CpuCount: runtime.NumCPU(),
}
return s, nil
}