util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(b int64) string

FormatBytes formats byte counts using decimal units (1 KB = 1000 bytes).

func FormatRate

func FormatRate(bps float64) string

FormatRate formats bytes per second using decimal units (1 KB/s = 1000 B/s).

Types

type InterfaceStat

type InterfaceStat struct {
	Name    string
	RxBytes uint64
	TxBytes uint64
}

InterfaceStat represents raw network device statistics

func ReadInterfaceStats

func ReadInterfaceStats() ([]InterfaceStat, error)

ReadInterfaceStats reads raw byte counters from /proc/net/dev

Jump to

Keyboard shortcuts

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