gosi

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 15 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gosi

System Information library for Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrawlDirs

func CrawlDirs(criteria string, keyFile ...string) ([]string, error)

CrawlDirs 渡されたcriteriaの直下にあるディレクトリの中に、keyFileが存在している場合のみディレクトリ名を配列で返す keyFileが省略されるか、1つめが空なら直下のディレクトリを全部返す。2つ目以降のkeyFileがあっても無視する

func RefreshCpu

func RefreshCpu()

RefreshCpu グローバル変数のCPU情報を更新

Types

type CpuStat

type CpuStat struct {
	Total  float64 `json:"total"`
	Num    int     `json:"num"`
	Load1  string  `json:"load1"`
	Load5  string  `json:"load5"`
	Load15 string  `json:"load15"`
}

func Cpu

func Cpu() *CpuStat

Cpu CPU情報を取得

func (CpuStat) Json

func (c CpuStat) Json() []byte

type DiskStat

type DiskStat struct {
	Name        string `json:"name"`
	Total       string `json:"total"`
	Free        string `json:"free"`
	Used        string `json:"used"`
	UsedPercent uint   `json:"usedPercent"`
}

type DiskStats

type DiskStats []DiskStat

func Disk

func Disk() DiskStats

func (DiskStats) Json

func (d DiskStats) Json() []byte

type InfoStat

type InfoStat struct {
	Hostname        string   `json:"hostname"`
	OS              string   `json:"os"`
	Platform        string   `json:"platform"`
	PlatformFamily  string   `json:"platformFamily"`
	PlatformVersion string   `json:"platformVersion"`
	KernelArch      string   `json:"kernelArch"`
	Uptime          string   `json:"uptime"`
	BootTime        string   `json:"bootTime"`
	ServerTime      string   `json:"serverTime"`
	CpuTemperature  string   `json:"cpuTemperature"`
	IpAddres        []IpAddr `json:"ipaddr"`
}

func Info

func Info() *InfoStat

Info ホスト情報を取得

func (InfoStat) Json

func (s InfoStat) Json() []byte

type IpAddr

type IpAddr struct {
	Name   string `json:"name"`
	IpAddr string `json:"ipaddr"`
}

type MemStat

type MemStat struct {
	Total       string `json:"total"`
	Available   string `json:"available"`
	Used        string `json:"used"`
	UsedPercent uint   `json:"usedPercent"`
}

func Mem

func Mem() *MemStat

func (MemStat) Json

func (m MemStat) Json() []byte

Jump to

Keyboard shortcuts

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