rate

package
v0.33.13 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRateConn

func NewRateConn(conn io.ReadWriteCloser, rate *Rate) io.ReadWriteCloser

Types

type Rate

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

func NewRate

func NewRate(limitBps int64) *Rate

func (*Rate) Get

func (r *Rate) Get(size int64)

func (*Rate) Limit added in v0.33.13

func (r *Rate) Limit() int64

func (*Rate) MarshalJSON added in v0.33.13

func (r *Rate) MarshalJSON() ([]byte, error)

func (*Rate) Now added in v0.33.13

func (r *Rate) Now() int64

func (*Rate) ReturnBucket

func (r *Rate) ReturnBucket(size int64)

func (*Rate) Start

func (r *Rate) Start()

func (*Rate) Stop

func (r *Rate) Stop()

Jump to

Keyboard shortcuts

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