network

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 24 Imported by: ? modules, 0 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.

Documentation

Index

Constants

View Source
const UDPPort = 9

Variables

This section is empty.

Functions

func NewDiscoveryCmd added in v0.1.6

func NewDiscoveryCmd() *cobra.Command

func NewIpCmd

func NewIpCmd() *cobra.Command

func NewWolCmd

func NewWolCmd() *cobra.Command

Types

type Addr added in v0.1.6

type Addr struct {
	IsV4  bool
	Value string
}

addr地址

type Addrs added in v0.1.6

type Addrs struct {
	Name  string
	Mac   string
	Addrs []*Addr
}

type Cache added in v0.1.6

type Cache struct {
	Account string   `json:"account"`
	Metrics *Metrics `json:"metrics"`
}

type Cpu added in v0.1.6

type Cpu struct {
	InfoStat []cpu.InfoStat  `json:"info_stat,omitempty"`
	TimeStat []cpu.TimesStat `json:"time_stat,omitempty"`
}

type Disk added in v0.1.6

type Disk struct {
	IOCountersStat map[string]disk.IOCountersStat `json:"iocounters_stat,omitempty"`
	PartitionStat  []disk.PartitionStat           `json:"partition_stat,omitempty"`
	UsageStat      *disk.UsageStat                `json:"usage_stat,omitempty"`
}

type Host added in v0.1.6

type Host struct {
	InfoStat *host.InfoStat `json:"info_stat,omitempty"`
}

type Hysteria added in v0.1.6

type Hysteria struct {
	Interface string   `json:"interface,omitempty"` // 网卡名字
	Proxy     []string `json:"proxy,omitempty"`     // 代理url ip:port
}

*

  • proxy

type Load added in v0.1.6

type Load struct {
	AvgStat *load.AvgStat `json:"avg_stat,omitempty"` // 当前负载
}

type Memory added in v0.1.6

type Memory struct {
	SwapDevice        [][]*mem.SwapDevice      `json:"swap_device,omitempty"`         // 交换分区 可能不存在
	SwapMemoryStat    []*mem.SwapMemoryStat    `json:"swap_memory_stat,omitempty"`    // 交换分区 内存统计
	VirtualMemoryStat []*mem.VirtualMemoryStat `json:"virtual_memory_stat,omitempty"` // 系统内容 统计
}

type Metrics added in v0.1.6

type Metrics struct {
	CreateTime time.Time `json:"create_time,omitempty"` // 上报事件
	Cpu        *Cpu      `json:"cpu,omitempty"`         //  cpu
	Disk       *Disk     `json:"disk,omitempty"`        // 磁盘
	Host       *Host     `json:"host,omitempty"`        // 主机
	Load       []*Load   `json:"load,omitempty"`        // 负载
	Memory     *Memory   `json:"memory,omitempty"`      // 内存
	Net        *Net      `json:"net,omitempty"`         // 网络配置
	Process    *Process  `json:"process,omitempty"`     // 当前进程
	Hysteria   *Hysteria `json:"hysteria,omitempty"`    // 代理信息
}

type Net added in v0.1.6

type Net struct {
	InterfaceStatList []snet.InterfaceStatList           `json:"interface_stat_list,omitempty"` // 网卡 mac地址、获取的ip、mtu、
	IOCountersStat    [][]snet.IOCountersStat            `json:"iocounters,omitempty"`          // 网络io
	ConnectionStat    []map[string][]snet.ConnectionStat `json:"connection,omitempty"`          // 查看网卡连接统计,根据Kind类型过滤
	ConntrackStat     [][]snet.ConntrackStat             `json:"conntrack,omitempty"`           //
}

type Process added in v0.1.6

type Process struct {
	Process        process.Process `json:"process,omitempty"`
	Pid            string          `json:"pid,omitempty"`
	Name           string          `json:"name,omitempty"`
	Status         string          `json:"status,omitempty"` // R: Running S: Sleep T: Stop I: Idle Z: Zombie W: Wait L: Lock
	Running        bool            `json:"running,omitempty"`
	CreateTime     int64           `json:"createTime,omitempty"`
	MemoryPercent  float32
	CPUPercent     float64
	Groups         []int32
	Cmdline        string
	Exe            string   `json:"exe,omitempty"`     // 可执行文件的完整路径
	Cwd            string   `json:"cwd,omitempty"`     // 工作目录
	Environ        []string `json:"environ,omitempty"` // 当前process使用的env
	MemoryInfoStat *process.MemoryInfoStat
	TimesStat      cpu.TimesStat
	NumThreads     int32                   `json:"num_threads,omitempty"`     // 当前使用多少个threads
	IOCountersStat *process.IOCountersStat `json:"iocounters_stat,omitempty"` // 进程的io统计
}

Jump to

Keyboard shortcuts

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