Index | Files

package netspeed

import ""

Package netspeed provides an i3bar module to display network utilisation.


Package Files


type Module Uses

type Module struct {
    // contains filtered or unexported fields

Module represents a netspeed bar module. It supports setting the output format, click handler, and update frequency.

func New Uses

func New(iface string) *Module

New constructs an instance of the netspeed module for the given interface.

func (*Module) Output Uses

func (m *Module) Output(outputFunc func(Speeds) bar.Output) *Module

Output configures a module to display the output of a user-defined function.

func (*Module) RefreshInterval Uses

func (m *Module) RefreshInterval(interval time.Duration) *Module

RefreshInterval configures the polling frequency for network speed. Since there is no concept of an instantaneous network speed, the speeds will be averaged over this interval before being displayed.

func (*Module) Stream Uses

func (m *Module) Stream(s bar.Sink)

Stream starts the module.

type Speeds Uses

type Speeds struct {
    Rx, Tx unit.Datarate
    // contains filtered or unexported fields

Speeds represents bidirectional network traffic.

func (Speeds) Connected Uses

func (s Speeds) Connected() bool

Connected returns true if the network is connected.

func (Speeds) Total Uses

func (s Speeds) Total() unit.Datarate

Total gets the total speed (both up and down).

Package netspeed imports 9 packages (graph) and is imported by 2 packages. Updated 2019-03-15. Refresh now. Tools for package owners.