rl

package
v0.0.0-...-4f40efb Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

rate-limited reader.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Timing

func Timing(r io.Reader)

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

func (*RateLimiter) Read

func (r *RateLimiter) Read(p []byte) (n int, err error)

type Test

type Test struct {
}

func (*Test) Name

func (m *Test) Name() string

func (*Test) Run

func (m *Test) Run(args []string)

Jump to

Keyboard shortcuts

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