Documentation ¶
Index ¶
- type Manager
- func (m *Manager) Close() error
- func (m *Manager) ClosedConnections() []TrackerMetadata
- func (m *Manager) Connection(id uuid.UUID) Tracker
- func (m *Manager) Connections() []TrackerMetadata
- func (m *Manager) ConnectionsLen() int
- func (m *Manager) Join(c Tracker)
- func (m *Manager) Leave(c Tracker)
- func (m *Manager) Now() (up int64, down int64)
- func (m *Manager) PushDownloaded(size int64)
- func (m *Manager) PushUploaded(size int64)
- func (m *Manager) ResetStatistic()
- func (m *Manager) Snapshot() *Snapshot
- func (m *Manager) Total() (up int64, down int64)
- type Snapshot
- type TCPConn
- type Tracker
- type TrackerMetadata
- type UDPConn
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) ClosedConnections ¶
func (m *Manager) ClosedConnections() []TrackerMetadata
func (*Manager) Connection ¶
func (*Manager) Connections ¶
func (m *Manager) Connections() []TrackerMetadata
func (*Manager) ConnectionsLen ¶
func (*Manager) PushDownloaded ¶
func (*Manager) PushUploaded ¶
func (*Manager) ResetStatistic ¶
func (m *Manager) ResetStatistic()
type Snapshot ¶
func (*Snapshot) MarshalJSON ¶
type TCPConn ¶
type TCPConn struct { N.ExtendedConn // contains filtered or unexported fields }
func NewTCPTracker ¶
func (*TCPConn) Metadata ¶
func (tt *TCPConn) Metadata() TrackerMetadata
func (*TCPConn) ReaderReplaceable ¶
func (*TCPConn) WriterReplaceable ¶
type TrackerMetadata ¶
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 ¶
func (t TrackerMetadata) MarshalJSON() ([]byte, error)
type UDPConn ¶
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) Metadata ¶
func (ut *UDPConn) Metadata() TrackerMetadata
func (*UDPConn) ReaderReplaceable ¶
func (*UDPConn) WriterReplaceable ¶
Click to show internal directories.
Click to hide internal directories.