wifibytes

package
Version: v0.0.0-...-bf74b40 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

wifibytes is a package for calculating the number of kilobits per seconds are going over a given network interface.

   client, err := wifibytes.NewClient(10, "wlp2s0")
   if err != nil {
	   // handle error
   }
   down, up, err := client.GetKilobitsPerSecond()
   if err != nil {
	   // handle error
   }
   // We now have download speed and upload speed

wifi bytes is a package for examing how many bytes are being transmitted over a wireless network interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(numReads int, device string) (*Client, error)

NewClient returns a new client ready for reading numReads is how big the user wishes the buffer of previous data points to be.

func (*Client) GetKilobitsPerSecond

func (c *Client) GetKilobitsPerSecond() (float64, float64, error)

GetKilobitsPerSecond will return the number of kilobits per second which are currently going over the network interface. The caller is expected to know how big the internal buffer and how long between calls are used.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL