network

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetworkStats

type NetworkStats struct {
	Name        string `json:"name"`        // network interface name
	Received    uint64 `json:"received"`    // total number of bytes of data received
	Transmitted uint64 `json:"transmitted"` // total number of bytes of data transmitted
}

NetworkStats represents network statistics

func (*NetworkStats) String

func (ns *NetworkStats) String() string

func (*NetworkStats) Subtract

func (ns *NetworkStats) Subtract(s *NetworkStats)

type NetworkUsage

type NetworkUsage struct {
	NetworkStats
	Delta time.Duration
}

func (*NetworkUsage) ReceiveSpeed

func (nu *NetworkUsage) ReceiveSpeed() float64

ReceiveSpeed get receive speed bytes/second

func (*NetworkUsage) String

func (nu *NetworkUsage) String() string

func (*NetworkUsage) TransmitSpeed

func (nu *NetworkUsage) TransmitSpeed() float64

TransmitSpeed get transmit speed bytes/second

type NetworksStats

type NetworksStats []NetworkStats

func GetNetworksStats

func GetNetworksStats() (NetworksStats, error)

GetNetworksStats get network statistics

func (NetworksStats) Subtract

func (nss NetworksStats) Subtract(ss NetworksStats)

type NetworksUsage

type NetworksUsage []NetworkUsage

func GetNetworksUsage

func GetNetworksUsage(delta time.Duration) (nsu NetworksUsage, err error)

GetNetworksUsage get networks usage between delta duration

Jump to

Keyboard shortcuts

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