upnpstats

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouterScanner

type RouterScanner struct {
	// contains filtered or unexported fields
}

RouterScanner scans upnp-enabled routers for network statistics

func New

func New(router *url.URL) (scanner *RouterScanner, err error)

New creates a new RouterScanner. If router is provided, only that URL will be scanned. Otherwise, New will scan the network for compatible routers.

func (*RouterScanner) ReportNetworkStats

func (scanner *RouterScanner) ReportNetworkStats() (stats []Stats, err error)

ReportNetworkStats scans all routers for updated network statistics

func (*RouterScanner) Routers

func (scanner *RouterScanner) Routers() (routers []string)

Routers returns the list of routers

type Scanner

type Scanner interface {
	ReportNetworkStats() (stats []Stats, err error)
	Routers() (routers []string)
}

Scanner interface scans upnp-enabled routers for network statistics

type Stats

type Stats struct {
	RouterURL       string
	PacketsSent     uint32
	PacketsReceived uint32
	BytesSent       uint64
	BytesReceived   uint64
}

Stats contains the statistics scanned from a router

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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