network

package
v0.0.0-...-3c503c0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrackingPeriod = 30 // minutes
	DefaultSnapLen = 262144
)

Variables

This section is empty.

Functions

func GetDefaultInterface

func GetDefaultInterface() (*net.Interface, error)

GetDefaultInterface returns the interface for the default interface This refers to the interface with the primary route (also seen in bash through ip route show)

Types

type Network

type Network struct {
	Usage NetworkUsage
}

func (*Network) PollNetworkUsage

func (n *Network) PollNetworkUsage(ctx context.Context)

type NetworkUsage

type NetworkUsage struct {
	Inbound  [TrackingPeriod]uint64 `json:"inbound"`
	Outbound [TrackingPeriod]uint64 `json:"outbound"`
}

Jump to

Keyboard shortcuts

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