Documentation ¶
Index ¶
- func NewConnCounter(conn net.Conn, s *TrafficStorage) net.Conn
- func NewPacketConnCounter(conn network.PacketConn, s *TrafficStorage) network.PacketConn
- type ConnCounter
- func (c *ConnCounter) Read(b []byte) (n int, err error)
- func (c *ConnCounter) ReadBuffer(buffer *buf.Buffer) error
- func (c *ConnCounter) UnwrapReader() (io.Reader, []network.CountFunc)
- func (c *ConnCounter) UnwrapWriter() (io.Writer, []network.CountFunc)
- func (c *ConnCounter) Upstream() any
- func (c *ConnCounter) Write(b []byte) (n int, err error)
- func (c *ConnCounter) WriteBuffer(buffer *buf.Buffer) error
- type PacketConnCounter
- func (p *PacketConnCounter) ReadPacket(buff *buf.Buffer) (destination M.Socksaddr, err error)
- func (p *PacketConnCounter) UnwrapPacketReader() (network.PacketReader, []network.CountFunc)
- func (p *PacketConnCounter) UnwrapPacketWriter() (network.PacketWriter, []network.CountFunc)
- func (p *PacketConnCounter) Upstream() any
- func (p *PacketConnCounter) WritePacket(buff *buf.Buffer, destination M.Socksaddr) (err error)
- type TrafficCounter
- func (c *TrafficCounter) DecConn(auth string)
- func (c *TrafficCounter) Delete(id string)
- func (c *TrafficCounter) GetCounter(id string) *TrafficStorage
- func (c *TrafficCounter) GetDownCount(id string) int64
- func (c *TrafficCounter) GetUpCount(id string) int64
- func (c *TrafficCounter) IncConn(auth string)
- func (c *TrafficCounter) Len() int
- func (c *TrafficCounter) Reset(id string)
- func (c *TrafficCounter) Rx(id string, n int)
- func (c *TrafficCounter) Tx(id string, n int)
- type TrafficStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnCounter ¶
func NewConnCounter(conn net.Conn, s *TrafficStorage) net.Conn
func NewPacketConnCounter ¶
func NewPacketConnCounter(conn network.PacketConn, s *TrafficStorage) network.PacketConn
Types ¶
type ConnCounter ¶
type ConnCounter struct { network.ExtendedConn // contains filtered or unexported fields }
func (*ConnCounter) ReadBuffer ¶
func (c *ConnCounter) ReadBuffer(buffer *buf.Buffer) error
func (*ConnCounter) UnwrapReader ¶
func (c *ConnCounter) UnwrapReader() (io.Reader, []network.CountFunc)
func (*ConnCounter) UnwrapWriter ¶
func (c *ConnCounter) UnwrapWriter() (io.Writer, []network.CountFunc)
func (*ConnCounter) Upstream ¶
func (c *ConnCounter) Upstream() any
func (*ConnCounter) WriteBuffer ¶
func (c *ConnCounter) WriteBuffer(buffer *buf.Buffer) error
type PacketConnCounter ¶
type PacketConnCounter struct { network.PacketConn // contains filtered or unexported fields }
func (*PacketConnCounter) ReadPacket ¶
func (*PacketConnCounter) UnwrapPacketReader ¶
func (p *PacketConnCounter) UnwrapPacketReader() (network.PacketReader, []network.CountFunc)
func (*PacketConnCounter) UnwrapPacketWriter ¶
func (p *PacketConnCounter) UnwrapPacketWriter() (network.PacketWriter, []network.CountFunc)
func (*PacketConnCounter) Upstream ¶
func (p *PacketConnCounter) Upstream() any
func (*PacketConnCounter) WritePacket ¶
type TrafficCounter ¶
type TrafficCounter struct {
// contains filtered or unexported fields
}
func NewTrafficCounter ¶
func NewTrafficCounter() *TrafficCounter
func (*TrafficCounter) DecConn ¶
func (c *TrafficCounter) DecConn(auth string)
func (*TrafficCounter) Delete ¶
func (c *TrafficCounter) Delete(id string)
func (*TrafficCounter) GetCounter ¶
func (c *TrafficCounter) GetCounter(id string) *TrafficStorage
func (*TrafficCounter) GetDownCount ¶
func (c *TrafficCounter) GetDownCount(id string) int64
func (*TrafficCounter) GetUpCount ¶
func (c *TrafficCounter) GetUpCount(id string) int64
func (*TrafficCounter) IncConn ¶
func (c *TrafficCounter) IncConn(auth string)
func (*TrafficCounter) Len ¶
func (c *TrafficCounter) Len() int
func (*TrafficCounter) Reset ¶
func (c *TrafficCounter) Reset(id string)
func (*TrafficCounter) Rx ¶
func (c *TrafficCounter) Rx(id string, n int)
func (*TrafficCounter) Tx ¶
func (c *TrafficCounter) Tx(id string, n int)
Click to show internal directories.
Click to hide internal directories.