Documentation ¶
Overview ¶
rate-limited reader.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
meant for sessions of limited duration, since we're measuring bandwidth from start, not most-recently; so, feedback algorithm is probably not so stable in the long term.
func NewRateLimiter ¶
func NewRateLimiter(bps float64, r io.Reader) *RateLimiter
Click to show internal directories.
Click to hide internal directories.