usage

package
v0.0.0-...-d352228 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package usage provides a simple API for getting network usage info.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

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

Interface represents a network interface present on the system.

func OpenInterface

func OpenInterface(name string) (*Interface, error)

OpenInterface opens the interface with the specified name.

func (*Interface) In

func (i *Interface) In() (uint64, error)

In returns the number of bytes received by the interface since the last time that it was called, or since the interface was opened if it hasn't been called before.

func (*Interface) Out

func (i *Interface) Out() (uint64, error)

Out returns the number of bytes sent by the interface since the last time that it was called, or since the interface was opened if it hasn't been called before.

Jump to

Keyboard shortcuts

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