proc

package
v0.0.0-...-7a50bc8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

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.

func ReadInt64

func ReadInt64(file string) (int64, error)

ReadInt64 reads one int64 number from the first line of a file.

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.

type MountPoint

type MountPoint struct {
	Dev     string
	Path    string
	Fstype  string
	Options string
	Dump    int
	Fsck    int
}

Jump to

Keyboard shortcuts

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