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 26, 2021 License: MIT Imports: 5 Imported by: 0

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