Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DeviceStatsFile string = "/proc/det/dev"
The file that stores network device statistics.
View Source
var MountProcFile string = "/proc/mounts"
This is the location of the proc mount point. Typically this is only modified by unit testing.
Functions ¶
func InterfaceStats ¶
func InterfaceStats() (map[string]InterfaceStat, error)
Returns the interface statistics as a map keyed off the interface name.
func MountPoints ¶
func MountPoints() (map[string]*MountPoint, error)
Reads through /proc/mounts and returns the data associated with the mount points as a list of MountPoint structures.
func ParseSimpleProcFile ¶
func ParseSimpleProcFile( filename string, lf func(index int, line string) error, ef func(line, index int, elm string) error) error
Parses the given file into various elements. This function assumes basic white space semantics (' ' and '\t' for column splitting, and '\n' for row splitting.
Types ¶
type InterfaceStat ¶
type InterfaceStat struct { Device string RxBytes uint64 RxPackets uint64 RxErrors uint64 RxDrop uint64 RxFifo uint64 RxFrame uint64 RxCompressed uint64 RxMulticast uint64 TxBytes uint64 TxPackets uint64 TxErrors uint64 TxDrop uint64 TxFifo uint64 TxFrame uint64 TxCompressed uint64 TxMulticast uint64 }
Stores interface statistics that are gleaned from /proc/dev/net.
Click to show internal directories.
Click to hide internal directories.