user

package
v0.0.0-...-7311f6d Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TrackConn

type TrackConn struct {
	net.Conn
	*Traffic
}

func (*TrackConn) Read

func (c *TrackConn) Read(p []byte) (n int, err error)

func (*TrackConn) ReadFrom

func (c *TrackConn) ReadFrom(r io.Reader) (n int64, err error)

func (*TrackConn) Upstream

func (c *TrackConn) Upstream() any

func (*TrackConn) Write

func (c *TrackConn) Write(p []byte) (n int, err error)

func (*TrackConn) WriteTo

func (c *TrackConn) WriteTo(w io.Writer) (n int64, err error)

type TrackPacketConn

type TrackPacketConn struct {
	N.PacketConn
	*Traffic
}

func (*TrackPacketConn) ReadPacket

func (c *TrackPacketConn) ReadPacket(buffer *buf.Buffer) (M.Socksaddr, error)

func (*TrackPacketConn) Upstream

func (c *TrackPacketConn) Upstream() any

func (*TrackPacketConn) WritePacket

func (c *TrackPacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error

type Traffic

type Traffic struct {
	Upload   uint64
	Download uint64
}

type TrafficManager

type TrafficManager[U comparable] struct {
	// contains filtered or unexported fields
}

func NewTrafficManager

func NewTrafficManager[U comparable]() *TrafficManager[U]

func (*TrafficManager[U]) ReadTraffics

func (m *TrafficManager[U]) ReadTraffics() map[U]Traffic

func (*TrafficManager[U]) TrackConnection

func (m *TrafficManager[U]) TrackConnection(user U, conn net.Conn) net.Conn

func (*TrafficManager[U]) TrackPacketConnection

func (m *TrafficManager[U]) TrackPacketConnection(user U, conn N.PacketConn) N.PacketConn

Jump to

Keyboard shortcuts

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