network_monitor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 5 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetMonitor

type NetMonitor struct {
	Running bool

	// Hold error if exists
	Err error

	LinuxNetDevDir string

	Interfaces []string
	// contains filtered or unexported fields
}

NetMonitor: structure that hold methods to monitoring newtwork interfaces bandwidth.

func NetMonitorNew

func NetMonitorNew(interf string, interval float64) (nt *NetMonitor, err error)

NetMonitorNew: Create a new structure that hold methods to monitoring newtwork interfaces.

func (*NetMonitor) GetAvailableInterfaces

func (nt *NetMonitor) GetAvailableInterfaces() ([]string, error)

GetAvailableInterfaces: Getting all available interfaces

func (*NetMonitor) GetCurrInterface

func (nt *NetMonitor) GetCurrInterface() string

func (*NetMonitor) SetInterface

func (nt *NetMonitor) SetInterface(interf string) error

func (*NetMonitor) SetInterval

func (nt *NetMonitor) SetInterval(interval float64)

func (*NetMonitor) Start

func (nt *NetMonitor) Start(callback func(stats *NetStat))

func (*NetMonitor) Stop

func (nt *NetMonitor) Stop()

type NetStat

type NetStat struct {
	Dev  []string
	Stat map[string]*devStat
}

Jump to

Keyboard shortcuts

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