Documentation ¶
Index ¶
- type MockSystemResourceInfoImpl
- func (mock *MockSystemResourceInfoImpl) FormatBytes(bytes uint64) string
- func (mock *MockSystemResourceInfoImpl) GetCPUSpeed() (float64, error)
- func (mock *MockSystemResourceInfoImpl) GetDiskPartitions(all bool) ([]disk.PartitionStat, error)
- func (mock *MockSystemResourceInfoImpl) GetDiskSpaceInfo(dirPath string) (disk.UsageStat, error)
- func (mock *MockSystemResourceInfoImpl) GetFilePermission(dirPath string) (fs.FileMode, error)
- func (mock *MockSystemResourceInfoImpl) GetMemory() (float64, error)
- func (mock *MockSystemResourceInfoImpl) GetNumberOfCPU() int
- type SystemResourceInfo
- type SystemResourceInfoImpl
- func (s *SystemResourceInfoImpl) FormatBytes(bytes uint64) string
- func (s *SystemResourceInfoImpl) GetCPUSpeed() (float64, error)
- func (s *SystemResourceInfoImpl) GetDiskPartitions(all bool) ([]disk.PartitionStat, error)
- func (s *SystemResourceInfoImpl) GetDiskSpaceInfo(dirPath string) (disk.UsageStat, error)
- func (srs *SystemResourceInfoImpl) GetFilePermission(dirPath string) (fs.FileMode, error)
- func (s *SystemResourceInfoImpl) GetMemory() (float64, error)
- func (s *SystemResourceInfoImpl) GetNumberOfCPU() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockSystemResourceInfoImpl ¶
type MockSystemResourceInfoImpl struct { GetNumberOfCPUFunc func() int GetCPUSpeedFunc func() (float64, error) GetMemoryFunc func() (float64, error) GetDiskSpaceInfoFunc func(string) (disk.UsageStat, error) GetDiskPartitionsFunc func(all bool) ([]disk.PartitionStat, error) FormatBytesFunc func(bytes uint64) string GetFilePermissionFunc func(string) (fs.FileMode, error) }
func (*MockSystemResourceInfoImpl) FormatBytes ¶
func (mock *MockSystemResourceInfoImpl) FormatBytes(bytes uint64) string
func (*MockSystemResourceInfoImpl) GetCPUSpeed ¶
func (mock *MockSystemResourceInfoImpl) GetCPUSpeed() (float64, error)
func (*MockSystemResourceInfoImpl) GetDiskPartitions ¶
func (mock *MockSystemResourceInfoImpl) GetDiskPartitions(all bool) ([]disk.PartitionStat, error)
func (*MockSystemResourceInfoImpl) GetDiskSpaceInfo ¶
func (mock *MockSystemResourceInfoImpl) GetDiskSpaceInfo(dirPath string) (disk.UsageStat, error)
func (*MockSystemResourceInfoImpl) GetFilePermission ¶
func (mock *MockSystemResourceInfoImpl) GetFilePermission(dirPath string) (fs.FileMode, error)
func (*MockSystemResourceInfoImpl) GetMemory ¶
func (mock *MockSystemResourceInfoImpl) GetMemory() (float64, error)
func (*MockSystemResourceInfoImpl) GetNumberOfCPU ¶
func (mock *MockSystemResourceInfoImpl) GetNumberOfCPU() int
type SystemResourceInfo ¶
type SystemResourceInfo interface { GetNumberOfCPU() int GetCPUSpeed() (float64, error) GetMemory() (float64, error) GetDiskSpaceInfo(dirPath string) (disk.UsageStat, error) GetDiskPartitions(all bool) ([]disk.PartitionStat, error) FormatBytes(bytes uint64) string GetFilePermission(dirPath string) (fs.FileMode, error) }
type SystemResourceInfoImpl ¶
type SystemResourceInfoImpl struct{}
func NewSystemResourceInfoImpl ¶
func NewSystemResourceInfoImpl() *SystemResourceInfoImpl
func (*SystemResourceInfoImpl) FormatBytes ¶
func (s *SystemResourceInfoImpl) FormatBytes(bytes uint64) string
func (*SystemResourceInfoImpl) GetCPUSpeed ¶
func (s *SystemResourceInfoImpl) GetCPUSpeed() (float64, error)
func (*SystemResourceInfoImpl) GetDiskPartitions ¶
func (s *SystemResourceInfoImpl) GetDiskPartitions(all bool) ([]disk.PartitionStat, error)
func (*SystemResourceInfoImpl) GetDiskSpaceInfo ¶
func (s *SystemResourceInfoImpl) GetDiskSpaceInfo(dirPath string) (disk.UsageStat, error)
func (*SystemResourceInfoImpl) GetFilePermission ¶
func (srs *SystemResourceInfoImpl) GetFilePermission(dirPath string) (fs.FileMode, error)
func (*SystemResourceInfoImpl) GetMemory ¶
func (s *SystemResourceInfoImpl) GetMemory() (float64, error)
func (*SystemResourceInfoImpl) GetNumberOfCPU ¶
func (s *SystemResourceInfoImpl) GetNumberOfCPU() int
Click to show internal directories.
Click to hide internal directories.