Documentation
¶
Index ¶
- func CalculateNetworkRates(initialStats map[string][2]int64, interfaceName string) (downloadRate, uploadRate int64, err error)
- func Cexec(command string) (string, error)
- func GetActiveInterface(stats map[string][2]int64) (string, error)
- func GetNetworkStats() (map[string][2]int64, error)
- func PassInts(values ...string) ([]int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateNetworkRates ¶
func CalculateNetworkRates(initialStats map[string][2]int64, interfaceName string) (downloadRate, uploadRate int64, err error)
CalculateNetworkRates calculates the download and upload rates for the active network interface.
func Cexec ¶
Cexec executes a command in the default shell and captures the standard output (stdout) and errors (stderr). It identifies the shell being used by checking the SHELL environment variable.
func GetActiveInterface ¶
GetActiveInterface returns the name of the active network interface.
func GetNetworkStats ¶
GetNetworkStats reads the network statistics from /proc/net/dev and returns a map of interface names to their received and transmitted bytes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.