statistic

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTCPTracker

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

func NewUDPTracker

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

Types

type Manager

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

func (*Manager) CloseAllConnections

func (m *Manager) CloseAllConnections()

func (*Manager) Connections

func (m *Manager) Connections() []tracker

func (*Manager) GetTotal

func (m *Manager) GetTotal() *Total

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(rule constants.IpRule) (up int64, down int64)

func (*Manager) PushDownloaded

func (m *Manager) PushDownloaded(size int64, rule constants.IpRule)

func (*Manager) PushUploaded

func (m *Manager) PushUploaded(size int64, rule constants.IpRule)

func (*Manager) ResetStatistic

func (m *Manager) ResetStatistic(rule constants.IpRule)

type SnapshotStatistic

type SnapshotStatistic struct {
	DownloadTotal int64 `json:"download"`
	UploadTotal   int64 `json:"upload"`
}

type Statistic

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

type Total

type Total struct {
	Proxy  SnapshotStatistic `json:"proxy"`
	Direct SnapshotStatistic `json:"direct"`
}

Jump to

Keyboard shortcuts

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