hardwareService

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

*

  • ______ __
  • /\__ _\ /\ \
  • \/_/\ \/ ___ __\ \ \ __ ___ ___ __
  • \ \ \ / ___\ / __ \ \ \ __ / __ \ / _ \ / ___\ / __ \
  • \_\ \__/\ \__//\ __/\ \ \_\ \/\ \_\ \_/\ \/\ \/\ \__//\ __/
  • /\_____\ \____\ \____\\ \____/\ \__/ \_\ \_\ \_\ \____\ \____\
  • \/_____/\/____/\/____/ \/___/ \/__/\/_/\/_/\/_/\/____/\/____/ * *
  • @寒冰
  • www.icezzz.cn
  • hanbin020706@163.com

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNetInfo added in v0.1.7

func CreateNetInfo() map[string]*NetInfo

func GetCpuPercent added in v0.1.8

func GetCpuPercent() float64

Types

type CpuInfo

type CpuInfo struct {
	ModelName string  `json:"model_name" toml:"model_name"`
	Cores     int32   `json:"cores" toml:"cores"`
	Mhz       float64 `json:"mhz" toml:"mhz"`
	CacheSize int32   `json:"cache_size" toml:"cache_size"`
}

func GetCpuInfo

func GetCpuInfo() []*CpuInfo

type DiskInfo

type DiskInfo struct {
	Fstype      string  `json:"fstype" toml:"fstype"`
	Total       uint64  `json:"total" toml:"total"`
	Free        uint64  `json:"free" toml:"free"`
	Used        uint64  `json:"used" toml:"used"`
	UsedPercent float64 `json:"used_percent" toml:"used_percent"`
}

func GetDiskInfo

func GetDiskInfo() *DiskInfo

type HostInfo

type HostInfo struct {
	Hostname        string `json:"hostname" toml:"hostname"`
	OS              string `json:"os" toml:"os"`
	Platform        string `json:"platform" toml:"platform"`
	PlatformVersion string `json:"platform_version" toml:"platform_version"`
	KernelVersion   string `json:"kernel_version" toml:"kernel_version"`
	KernelArch      string `json:"kernel_arch" toml:"kernel_arch"`
	Hostid          string `json:"hostid" toml:"hostid"`
}

func GetHostInfo

func GetHostInfo() *HostInfo

type MemInfo

type MemInfo struct {
	Total       int     `json:"total" toml:"total"`
	Used        int     `json:"used" toml:"used"`
	Free        int     `json:"free" toml:"free"`
	UsedPercent float64 `json:"used_percent" toml:"used_percent"`
}

func GetMemInfo

func GetMemInfo() *MemInfo

type NetInfo

type NetInfo struct {
	Name         string `json:"name" toml:"name"`
	Hardwareaddr string `json:"hardwareaddr" toml:"hardwareaddr"`
	Addrs        string `json:"addrs" toml:"addrs"`
	// contains filtered or unexported fields
}

func (*NetInfo) GetNetSpeed added in v0.1.8

func (ni *NetInfo) GetNetSpeed() (upspeed float32, downspeed float32)

type SYSTEM

type SYSTEM struct {
	CPU  []*CpuInfo          `json:"cpu" toml:"cpu"`
	DISK *DiskInfo           `json:"disk" toml:"disk"`
	NET  map[string]*NetInfo `json:"net" toml:"net"`
	HOST *HostInfo           `json:"host" toml:"host"`
	MEM  *MemInfo            `json:"mem" toml:"mem"`

	service.Entity
	// contains filtered or unexported fields
}

func (*SYSTEM) Start

func (s *SYSTEM) Start()

func (*SYSTEM) Stop

func (s *SYSTEM) Stop()

Jump to

Keyboard shortcuts

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