statistic

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTCPTracker

func NewTCPTracker(conn C.Conn, manager *Manager, metadata *C.Metadata, rule C.Rule) *tcpTracker

func NewUDPTracker

func NewUDPTracker(conn C.PacketConn, manager *Manager, metadata *C.Metadata, rule C.Rule) *udpTracker

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}
var DefaultManager *Manager

func (*Manager) Join

func (m *Manager) Join(c tracker)

func (*Manager) Leave

func (m *Manager) Leave(c tracker)

func (*Manager) Now

func (m *Manager) Now() (up int64, down int64)

func (*Manager) PushDownloaded

func (m *Manager) PushDownloaded(size int64)

func (*Manager) PushUploaded

func (m *Manager) PushUploaded(size int64)

func (*Manager) ResetStatistic

func (m *Manager) ResetStatistic()

func (*Manager) Snapshot

func (m *Manager) Snapshot() *Snapshot

type Snapshot

type Snapshot struct {
	DownloadTotal int64     `json:"downloadTotal"`
	UploadTotal   int64     `json:"uploadTotal"`
	Connections   []tracker `json:"connections"`
}

Jump to

Keyboard shortcuts

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