rate

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPacketConnCounter

func NewPacketConnCounter(conn network.PacketConn, l *ratelimit.Bucket) network.PacketConn

func NewRateLimitWriter

func NewRateLimitWriter(writer buf.Writer, limiter *ratelimit.Bucket) buf.Writer

Types

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewConnRateLimiter

func NewConnRateLimiter(c net.Conn, l *ratelimit.Bucket) *Conn

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, err error)

func (*Conn) Write

func (c *Conn) Write(b []byte) (n int, err error)

type PacketConnCounter

type PacketConnCounter struct {
	network.PacketConn
	// contains filtered or unexported fields
}

func (*PacketConnCounter) ReadPacket

func (p *PacketConnCounter) ReadPacket(buff *buf.Buffer) (destination M.Socksaddr, err error)

func (*PacketConnCounter) WritePacket

func (p *PacketConnCounter) WritePacket(buff *buf.Buffer, destination M.Socksaddr) (err error)

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) WriteMultiBuffer

func (w *Writer) WriteMultiBuffer(mb buf.MultiBuffer) error

Jump to

Keyboard shortcuts

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