mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 12:57:54 +00:00
Unexport gopsutil.SystemInfo
This commit is contained in:
parent
7db07ea72e
commit
6c53ecc333
1 changed files with 13 additions and 13 deletions
|
|
@ -22,15 +22,15 @@ import (
|
|||
|
||||
var _ pilosa.SystemInfo = NewSystemInfo()
|
||||
|
||||
// SystemInfo is an implementation of pilosa.SystemInfo that uses gopsutil to collect information about the host OS.
|
||||
type SystemInfo struct {
|
||||
// systemInfo is an implementation of pilosa.systemInfo that uses gopsutil to collect information about the host OS.
|
||||
type systemInfo struct {
|
||||
platform string
|
||||
family string
|
||||
osVersion string
|
||||
}
|
||||
|
||||
// Uptime returns the system uptime in seconds.
|
||||
func (s *SystemInfo) Uptime() (uptime uint64, err error) {
|
||||
func (s *systemInfo) Uptime() (uptime uint64, err error) {
|
||||
hostInfo, err := host.Info()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
@ -39,7 +39,7 @@ func (s *SystemInfo) Uptime() (uptime uint64, err error) {
|
|||
}
|
||||
|
||||
// collectPlatformInfo fetches and caches system platform information.
|
||||
func (s *SystemInfo) collectPlatformInfo() error {
|
||||
func (s *systemInfo) collectPlatformInfo() error {
|
||||
var err error
|
||||
if s.platform == "" {
|
||||
s.platform, s.family, s.osVersion, err = host.PlatformInformation()
|
||||
|
|
@ -51,7 +51,7 @@ func (s *SystemInfo) collectPlatformInfo() error {
|
|||
}
|
||||
|
||||
// Platform returns the system platform.
|
||||
func (s *SystemInfo) Platform() (string, error) {
|
||||
func (s *systemInfo) Platform() (string, error) {
|
||||
err := s.collectPlatformInfo()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
@ -60,7 +60,7 @@ func (s *SystemInfo) Platform() (string, error) {
|
|||
}
|
||||
|
||||
// Family returns the system family.
|
||||
func (s *SystemInfo) Family() (string, error) {
|
||||
func (s *systemInfo) Family() (string, error) {
|
||||
err := s.collectPlatformInfo()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
@ -69,7 +69,7 @@ func (s *SystemInfo) Family() (string, error) {
|
|||
}
|
||||
|
||||
// OSVersion returns the OS Version.
|
||||
func (s *SystemInfo) OSVersion() (string, error) {
|
||||
func (s *systemInfo) OSVersion() (string, error) {
|
||||
err := s.collectPlatformInfo()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
@ -78,7 +78,7 @@ func (s *SystemInfo) OSVersion() (string, error) {
|
|||
}
|
||||
|
||||
// MemFree returns the amount of free memory in bytes.
|
||||
func (s *SystemInfo) MemFree() (uint64, error) {
|
||||
func (s *systemInfo) MemFree() (uint64, error) {
|
||||
memInfo, err := mem.VirtualMemory()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
@ -87,7 +87,7 @@ func (s *SystemInfo) MemFree() (uint64, error) {
|
|||
}
|
||||
|
||||
// MemTotal returns the amount of total memory in bytes.
|
||||
func (s *SystemInfo) MemTotal() (uint64, error) {
|
||||
func (s *systemInfo) MemTotal() (uint64, error) {
|
||||
memInfo, err := mem.VirtualMemory()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
@ -96,7 +96,7 @@ func (s *SystemInfo) MemTotal() (uint64, error) {
|
|||
}
|
||||
|
||||
// MemUsed returns the amount of used memory in bytes.
|
||||
func (s *SystemInfo) MemUsed() (uint64, error) {
|
||||
func (s *systemInfo) MemUsed() (uint64, error) {
|
||||
memInfo, err := mem.VirtualMemory()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
|
@ -105,11 +105,11 @@ func (s *SystemInfo) MemUsed() (uint64, error) {
|
|||
}
|
||||
|
||||
// KernelVersion returns the kernel version as a string.
|
||||
func (s *SystemInfo) KernelVersion() (string, error) {
|
||||
func (s *systemInfo) KernelVersion() (string, error) {
|
||||
return host.KernelVersion()
|
||||
}
|
||||
|
||||
// NewSystemInfo is a constructor for the gopsutil implementation of SystemInfo.
|
||||
func NewSystemInfo() *SystemInfo {
|
||||
return &SystemInfo{}
|
||||
func NewSystemInfo() *systemInfo {
|
||||
return &systemInfo{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue