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 ¶ added in v1.10.0
func (m *Manager) ClosedConnections() []TrackerMetadata
func (*Manager) Connection ¶ added in v1.10.0
func (*Manager) Connections ¶ added in v1.3.3
func (m *Manager) Connections() []TrackerMetadata
func (*Manager) ConnectionsLen ¶ added in v1.10.0
func (*Manager) PushDownloaded ¶
func (*Manager) PushUploaded ¶
func (*Manager) ResetStatistic ¶
func (m *Manager) ResetStatistic()
type Snapshot ¶
func (*Snapshot) MarshalJSON ¶ added in v1.10.0
type TCPConn ¶ added in v1.10.0
type TCPConn struct { N.ExtendedConn // contains filtered or unexported fields }
func NewTCPTracker ¶
func (*TCPConn) Metadata ¶ added in v1.10.0
func (tt *TCPConn) Metadata() TrackerMetadata
func (*TCPConn) ReaderReplaceable ¶ added in v1.10.0
func (*TCPConn) WriterReplaceable ¶ added in v1.10.0
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) Metadata ¶ added in v1.10.0
func (ut *UDPConn) Metadata() TrackerMetadata
func (*UDPConn) ReaderReplaceable ¶ added in v1.10.0
func (*UDPConn) WriterReplaceable ¶ added in v1.10.0
Click to show internal directories.
Click to hide internal directories.