statistic

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.Policy) (up int64, down int64)

func (*Manager) PushDownloaded

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

func (*Manager) PushUploaded

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

func (*Manager) ResetStatistic

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

type SnapshotStatistic

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

type Statistic

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

type TcpTracker

type TcpTracker struct {
	net.Conn `json:"-"`
	// contains filtered or unexported fields
}

func NewTCPTracker

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

func (*TcpTracker) Close

func (tt *TcpTracker) Close() error

func (*TcpTracker) ID

func (tt *TcpTracker) ID() string

func (*TcpTracker) Read

func (tt *TcpTracker) Read(b []byte) (int, error)

func (*TcpTracker) Write

func (tt *TcpTracker) Write(b []byte) (int, error)

type Total

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

type UdpTracker

type UdpTracker struct {
	net.PacketConn `json:"-"`
	// contains filtered or unexported fields
}

func NewUDPTracker

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

func (*UdpTracker) Close

func (ut *UdpTracker) Close() error

func (*UdpTracker) ID

func (ut *UdpTracker) ID() string

func (*UdpTracker) ReadFrom

func (ut *UdpTracker) ReadFrom(b []byte) (int, net.Addr, error)

func (*UdpTracker) WriteTo

func (ut *UdpTracker) WriteTo(b []byte, addr net.Addr) (int, error)

Jump to

Keyboard shortcuts

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