systemresource

package
v0.0.0-...-be2ef80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL