trafficontrol

package
v1.11.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: GPL-2.0 Imports: 16 Imported by: 4

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
}

func NewManager

func NewManager() *Manager

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) ClosedConnections added in v1.10.0

func (m *Manager) ClosedConnections() []TrackerMetadata

func (*Manager) Connection added in v1.10.0

func (m *Manager) Connection(id uuid.UUID) Tracker

func (*Manager) Connections added in v1.3.3

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

func (*Manager) ConnectionsLen added in v1.10.0

func (m *Manager) ConnectionsLen() int

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

func (*Manager) Total added in v1.3.3

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

type Snapshot

type Snapshot struct {
	Download    int64
	Upload      int64
	Connections []Tracker
	Memory      uint64
}

func (*Snapshot) MarshalJSON added in v1.10.0

func (s *Snapshot) MarshalJSON() ([]byte, error)

type TCPConn added in v1.10.0

type TCPConn struct {
	N.ExtendedConn
	// contains filtered or unexported fields
}

func NewTCPTracker

func NewTCPTracker(conn net.Conn, manager *Manager, metadata adapter.InboundContext, router adapter.Router, rule adapter.Rule) *TCPConn

func (*TCPConn) Close added in v1.10.0

func (tt *TCPConn) Close() error

func (*TCPConn) Leave added in v1.10.0

func (tt *TCPConn) Leave()

func (*TCPConn) Metadata added in v1.10.0

func (tt *TCPConn) Metadata() TrackerMetadata

func (*TCPConn) ReaderReplaceable added in v1.10.0

func (tt *TCPConn) ReaderReplaceable() bool

func (*TCPConn) Upstream added in v1.10.0

func (tt *TCPConn) Upstream() any

func (*TCPConn) WriterReplaceable added in v1.10.0

func (tt *TCPConn) WriterReplaceable() bool

type Tracker added in v1.10.0

type Tracker interface {
	adapter.Tracker
	Metadata() TrackerMetadata
	Close() error
}

type TrackerMetadata added in v1.10.0

type TrackerMetadata struct {
	ID           uuid.UUID
	Metadata     adapter.InboundContext
	CreatedAt    time.Time
	ClosedAt     time.Time
	Upload       *atomic.Int64
	Download     *atomic.Int64
	Chain        []string
	Rule         adapter.Rule
	Outbound     string
	OutboundType string
}

func (TrackerMetadata) MarshalJSON added in v1.10.0

func (t TrackerMetadata) MarshalJSON() ([]byte, error)

type UDPConn added in v1.10.0

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

func NewUDPTracker

func NewUDPTracker(conn N.PacketConn, manager *Manager, metadata adapter.InboundContext, router adapter.Router, rule adapter.Rule) *UDPConn

func (*UDPConn) Close added in v1.10.0

func (ut *UDPConn) Close() error

func (*UDPConn) Leave added in v1.10.0

func (ut *UDPConn) Leave()

func (*UDPConn) Metadata added in v1.10.0

func (ut *UDPConn) Metadata() TrackerMetadata

func (*UDPConn) ReaderReplaceable added in v1.10.0

func (ut *UDPConn) ReaderReplaceable() bool

func (*UDPConn) Upstream added in v1.10.0

func (ut *UDPConn) Upstream() any

func (*UDPConn) WriterReplaceable added in v1.10.0

func (ut *UDPConn) WriterReplaceable() bool

Jump to

Keyboard shortcuts

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