traffic

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTrafficMonitor

func RegisterTrafficMonitor(name string)

Types

type Monitor

type Monitor struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func GetTrafficMonitor

func GetTrafficMonitor(name string) *Monitor

func NewMonitor

func NewMonitor() *Monitor

func (*Monitor) Data added in v1.0.3

func (monitor *Monitor) Data() MonitorDatas

func (*Monitor) Json

func (monitor *Monitor) Json() []byte

func (*Monitor) Traffic

func (monitor *Monitor) Traffic(name string) *Traffic

type MonitorData added in v1.0.3

type MonitorData struct {
	Name string `json:"name"`
	Sent uint64 `json:"sent"`
	Recv uint64 `json:"recv"`
}

type MonitorDatas added in v1.0.3

type MonitorDatas []*MonitorData

type Traffic

type Traffic struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Traffic) AddTraffic

func (traffic *Traffic) AddTraffic(sent, recv uint64)

func (*Traffic) GetTraffic

func (traffic *Traffic) GetTraffic() (uint64, uint64)

func (*Traffic) SetTraffic

func (traffic *Traffic) SetTraffic(sent, recv uint64)

Jump to

Keyboard shortcuts

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